Skip to content

Commit

Permalink
Canonicalize the header name to don't force the user to do it manually.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Ortiz <[email protected]>
  • Loading branch information
taik0 committed Apr 3, 2024
1 parent 5d6d11c commit 5d90f49
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 5d90f49

Please sign in to comment.