From d2ce83a6f8f5e4623db51f385d0531c2ed83f513 Mon Sep 17 00:00:00 2001 From: Pavel Korotkov Date: Tue, 28 Jul 2020 18:27:43 +0300 Subject: [PATCH] #2 Fix AWS V4 signature regexp We now respect possible spaces in parts of Authorization header field whoses presence causes problems for some client apps (such as aws cli). Signed-off-by: Pavel Korotkov --- auth/center.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth/center.go b/auth/center.go index 73ac018..5c53325 100644 --- a/auth/center.go +++ b/auth/center.go @@ -18,7 +18,7 @@ import ( "go.uber.org/zap" ) -var authorizationFieldRegexp = regexp.MustCompile(`AWS4-HMAC-SHA256 Credential=(?P[^/]+)/(?P[^/]+)/(?P[^/]*)/(?P[^/]+)/aws4_request, SignedHeaders=(?P.*), Signature=(?P.*)`) +var authorizationFieldRegexp = regexp.MustCompile(`AWS4-HMAC-SHA256 Credential=(?P[^/]+)/(?P[^/]+)/(?P[^/]*)/(?P[^/]+)/aws4_request,\s*SignedHeaders=(?P.+),\s*Signature=(?P.+)`) const emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`