forked from TrueCloudLab/frostfs-s3-gw
Move auth HTTP header field regexp to a package level variable
This commit is contained in:
parent
3355a54272
commit
e4f7a702dc
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
const authorizationFieldPattern = `AWS4-HMAC-SHA256 Credential=(?P<access_key_id>[^/]+)/(?P<date>[^/]+)/(?P<region>[^/]*)/(?P<service>[^/]+)/aws4_request, SignedHeaders=(?P<signed_header_fields>.*), Signature=(?P<v4_signature>.*)`
|
||||
var authorizationFieldRegexp = regexp.MustCompile(`AWS4-HMAC-SHA256 Credential=(?P<access_key_id>[^/]+)/(?P<date>[^/]+)/(?P<region>[^/]*)/(?P<service>[^/]+)/aws4_request, SignedHeaders=(?P<signed_header_fields>.*), Signature=(?P<v4_signature>.*)`)
|
||||
|
||||
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,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue