From 5d90f4920c87a76bd6d18842c8167dfede0d932b Mon Sep 17 00:00:00 2001 From: Daniel Ortiz Date: Wed, 3 Apr 2024 12:19:35 +0000 Subject: [PATCH] Canonicalize the header name to don't force the user to do it manually. Signed-off-by: Daniel Ortiz --- jws.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jws.go b/jws.go index 7b791a6..da84ffa 100644 --- a/jws.go +++ b/jws.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "fmt" + "net/textproto" "strings" "github.com/krakend/go-auth0" @@ -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 }