Skip to content

Commit

Permalink
Merge pull request #132 from krakend/canonicalize_header
Browse files Browse the repository at this point in the history
Canonicalize the header name to don't force the user to do it manually.
  • Loading branch information
kpacha authored Apr 4, 2024
2 parents 5d6d11c + 5d90f49 commit 33c87cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jws.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"net/textproto"
"strings"

"github.com/krakend/go-auth0"
Expand Down Expand Up @@ -82,6 +83,10 @@ func GetSignatureConfig(cfg *config.EndpointConfig) (*SignatureConfig, error) {
if !strings.HasPrefix(res.URI, "https://") && !res.DisableJWKSecurity {
return res, ErrInsecureJWKSource
}
if res.AuthHeaderName != "" {
res.AuthHeaderName = textproto.CanonicalMIMEHeaderKey(res.AuthHeaderName)
}

return res, nil
}

Expand Down

0 comments on commit 33c87cc

Please sign in to comment.