Browse Source

only disallow streaming signed when no auth enabled

fix https://github.com/chrislusf/seaweedfs/issues/2101
pull/2104/head
Chris Lu 4 years ago
parent
commit
2b60e2abb1
  1. 5
      weed/s3api/s3api_object_handlers.go

5
weed/s3api/s3api_object_handlers.go

@ -63,8 +63,8 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
} }
dataReader := r.Body dataReader := r.Body
rAuthType := getRequestAuthType(r)
if s3a.iam.isEnabled() { if s3a.iam.isEnabled() {
rAuthType := getRequestAuthType(r)
var s3ErrCode s3err.ErrorCode var s3ErrCode s3err.ErrorCode
switch rAuthType { switch rAuthType {
case authTypeStreamingSigned: case authTypeStreamingSigned:
@ -79,8 +79,7 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
return return
} }
} else { } else {
rAuthType := getRequestAuthType(r)
if authTypeAnonymous != rAuthType {
if authTypeStreamingSigned == rAuthType {
writeErrorResponse(w, s3err.ErrAuthNotSetup, r.URL) writeErrorResponse(w, s3err.ErrAuthNotSetup, r.URL)
return return
} }

Loading…
Cancel
Save