mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-24 02:59:13 +08:00
consistent error message if auth is not setup
fix https://github.com/seaweedfs/seaweedfs/issues/6262
This commit is contained in:
parent
254ed8897e
commit
6b2612690b
@ -228,8 +228,8 @@ func (s3a *S3ApiServer) PutObjectPartHandler(w http.ResponseWriter, r *http.Requ
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataReader := r.Body
|
dataReader := r.Body
|
||||||
if s3a.iam.isEnabled() {
|
|
||||||
rAuthType := getRequestAuthType(r)
|
rAuthType := getRequestAuthType(r)
|
||||||
|
if s3a.iam.isEnabled() {
|
||||||
var s3ErrCode s3err.ErrorCode
|
var s3ErrCode s3err.ErrorCode
|
||||||
switch rAuthType {
|
switch rAuthType {
|
||||||
case authTypeStreamingSigned:
|
case authTypeStreamingSigned:
|
||||||
@ -243,6 +243,11 @@ func (s3a *S3ApiServer) PutObjectPartHandler(w http.ResponseWriter, r *http.Requ
|
|||||||
s3err.WriteErrorResponse(w, r, s3ErrCode)
|
s3err.WriteErrorResponse(w, r, s3ErrCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if authTypeStreamingSigned == rAuthType {
|
||||||
|
s3err.WriteErrorResponse(w, r, s3err.ErrAuthNotSetup)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
defer dataReader.Close()
|
defer dataReader.Close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user