aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_auth.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2020-02-17 12:53:30 -0800
committerGitHub <noreply@github.com>2020-02-17 12:53:30 -0800
commit0a57db702614ec38ecd3032ee9ab8f50ab5d80e9 (patch)
treeb5aa5f41e6d4502f9843bff98cb140ee0f24a81d /weed/s3api/s3api_auth.go
parent9232d3ac68a8d23a7f67ec66d8e227c362431507 (diff)
parent4cdde5f569419535b4ded8b0e54d18ead13a6458 (diff)
downloadseaweedfs-0a57db702614ec38ecd3032ee9ab8f50ab5d80e9.tar.xz
seaweedfs-0a57db702614ec38ecd3032ee9ab8f50ab5d80e9.zip
Merge pull request #1200 from chrislusf/add_s3_acl
Add s3 ACL
Diffstat (limited to 'weed/s3api/s3api_auth.go')
-rw-r--r--weed/s3api/s3api_auth.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/s3api/s3api_auth.go b/weed/s3api/s3api_auth.go
index b680fe1e1..43afbaae5 100644
--- a/weed/s3api/s3api_auth.go
+++ b/weed/s3api/s3api_auth.go
@@ -9,6 +9,8 @@ import (
const (
signV4Algorithm = "AWS4-HMAC-SHA256"
signV2Algorithm = "AWS"
+ iso8601Format = "20060102T150405Z"
+ yyyymmdd = "20060102"
)
// Verify if request has JWT.
@@ -23,8 +25,8 @@ func isRequestSignatureV4(r *http.Request) bool {
// Verify if request has AWS Signature Version '2'.
func isRequestSignatureV2(r *http.Request) bool {
- return (!strings.HasPrefix(r.Header.Get("Authorization"), signV4Algorithm) &&
- strings.HasPrefix(r.Header.Get("Authorization"), signV2Algorithm))
+ return !strings.HasPrefix(r.Header.Get("Authorization"), signV4Algorithm) &&
+ strings.HasPrefix(r.Header.Get("Authorization"), signV2Algorithm)
}
// Verify if request has AWS PreSign Version '4'.