66 "time"
77
88 gogrpcmd "github.com/ralvarezdev/go-grpc/metadata"
9+ "google.golang.org/grpc/metadata"
910
1011 gonethttp "github.com/ralvarezdev/go-net/http"
1112 gonethttpcookie "github.com/ralvarezdev/go-net/http/cookie"
@@ -70,7 +71,7 @@ func (d DefaultAuthenticationParser) ParseAuthorizationMetadataAsHeader(
7071 w http.ResponseWriter ,
7172) error {
7273 // Get the metadata from the context
73- md , err := gogrpcmd .GetCtxMetadata (ctx )
74+ md , err := gogrpcmd .GetIncomingCtxMetadata (ctx )
7475 if err != nil {
7576 return gonethttpresponse .NewDebugError (
7677 err ,
@@ -118,15 +119,9 @@ func (d DefaultAuthenticationParser) ParseAuthorizationMetadataAsHeader(
118119//
119120// - error: error if something goes wrong
120121func (d DefaultAuthenticationParser ) ParseAuthorizationMetadataAsCookie (
121- ctx context. Context ,
122+ md metadata. MD ,
122123 w http.ResponseWriter ,
123124) error {
124- // Get the metadata from the context
125- md , err := gogrpcmd .GetCtxMetadata (ctx )
126- if err != nil {
127- return err
128- }
129-
130125 // Iterate over the metadata keys to cookies attributes
131126 for metadataKey , cookieAttributes := range d .options .MetadataKeysToCookiesAttributes {
132127 // Get the metadata value
@@ -139,7 +134,10 @@ func (d DefaultAuthenticationParser) ParseAuthorizationMetadataAsCookie(
139134 metadataValue := metadataValueSlice [0 ]
140135
141136 // Get the expiration time if the function is set
142- var expiresAt time.Time
137+ var (
138+ expiresAt time.Time
139+ err error
140+ )
143141 if d .options .GetExpiresAtFn != nil {
144142 expiresAt , err = d .options .GetExpiresAtFn (metadataValue )
145143 if err != nil {
0 commit comments