diff --git a/auth/center.go b/auth/center.go index fc629a86f..357977665 100644 --- a/auth/center.go +++ b/auth/center.go @@ -26,7 +26,7 @@ import ( "go.uber.org/zap" ) -const authorizationFieldPattern = `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, SignedHeaders=(?P.*), Signature=(?P.*)`) const emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` @@ -54,7 +54,7 @@ func NewCenter(log *zap.Logger) *Center { zstdDecoder, _ := zstd.NewReader(nil) return &Center{ log: log, - submatcher: ®expSubmatcher{re: regexp.MustCompile(authorizationFieldPattern)}, + submatcher: ®expSubmatcher{re: authorizationFieldRegexp}, zstdEncoder: zstdEncoder, zstdDecoder: zstdDecoder, }