aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruitao.liu <ruitao.liu@cloudminds.com>2020-11-12 17:59:31 +0800
committerruitao.liu <ruitao.liu@cloudminds.com>2020-11-12 17:59:31 +0800
commitc4f0fd6e1b2b66a988831bbcec15033aedb79420 (patch)
treee6b6e5215e281054191842608f668517c7e35265
parentab966410d2a180344d0275354aeac5c599bb7c66 (diff)
downloadseaweedfs-c4f0fd6e1b2b66a988831bbcec15033aedb79420.tar.xz
seaweedfs-c4f0fd6e1b2b66a988831bbcec15033aedb79420.zip
skip if entry.Extended map is nil.
-rw-r--r--weed/s3api/s3api_bucket_handlers.go22
1 files changed, 14 insertions, 8 deletions
diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go
index 1e6d710be..6b2ed8ef2 100644
--- a/weed/s3api/s3api_bucket_handlers.go
+++ b/weed/s3api/s3api_bucket_handlers.go
@@ -125,10 +125,13 @@ func (s3a *S3ApiServer) DeleteBucketHandler(w http.ResponseWriter, r *http.Reque
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
return
}
- if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
- if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
- writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
- return
+
+ if entry.Extended != nil {
+ if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
+ if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
+ writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
+ return
+ }
}
}
@@ -166,10 +169,13 @@ func (s3a *S3ApiServer) HeadBucketHandler(w http.ResponseWriter, r *http.Request
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
return
}
- if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
- if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
- writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
- return
+
+ if entry.Extended != nil {
+ if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
+ if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
+ writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
+ return
+ }
}
}