mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-21 19:10:11 +08:00
skip if entry.Extended map is nil.
This commit is contained in:
@@ -125,12 +125,15 @@ func (s3a *S3ApiServer) DeleteBucketHandler(w http.ResponseWriter, r *http.Reque
|
|||||||
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
|
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if entry.Extended != nil {
|
||||||
if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
|
if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
|
||||||
if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
|
if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
|
||||||
writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
|
writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = s3a.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
err = s3a.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
@@ -166,12 +169,15 @@ func (s3a *S3ApiServer) HeadBucketHandler(w http.ResponseWriter, r *http.Request
|
|||||||
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
|
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if entry.Extended != nil {
|
||||||
if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
|
if id, ok := entry.Extended[xhttp.AmzIdentityId]; ok {
|
||||||
if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
|
if string(id) != r.Header.Get(xhttp.AmzIdentityId) {
|
||||||
writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
|
writeErrorResponse(w, s3err.ErrAccessDenied, r.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
writeSuccessResponseEmpty(w)
|
writeSuccessResponseEmpty(w)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user