|
|
|
@ -640,21 +640,18 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req |
|
|
|
|
// Initialize stream signature verifier.
|
|
|
|
|
reader, s3Err = newSignV4ChunkedReader(r) |
|
|
|
|
if s3Err != ErrNone { |
|
|
|
|
errorIf(errSignatureMismatch, "%s", dumpRequest(r)) |
|
|
|
|
writeErrorResponse(w, s3Err, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
case authTypeSignedV2, authTypePresignedV2: |
|
|
|
|
s3Err = isReqAuthenticatedV2(r) |
|
|
|
|
if s3Err != ErrNone { |
|
|
|
|
errorIf(errSignatureMismatch, "%s", dumpRequest(r)) |
|
|
|
|
writeErrorResponse(w, s3Err, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case authTypePresigned, authTypeSigned: |
|
|
|
|
if s3Err = reqSignatureV4Verify(r, globalServerConfig.GetRegion()); s3Err != ErrNone { |
|
|
|
|
errorIf(errSignatureMismatch, "%s", dumpRequest(r)) |
|
|
|
|
writeErrorResponse(w, s3Err, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
@ -1069,20 +1066,17 @@ func (api objectAPIHandlers) PutObjectPartHandler(w http.ResponseWriter, r *http |
|
|
|
|
var s3Error APIErrorCode |
|
|
|
|
reader, s3Error = newSignV4ChunkedReader(r) |
|
|
|
|
if s3Error != ErrNone { |
|
|
|
|
errorIf(errSignatureMismatch, "%s", dumpRequest(r)) |
|
|
|
|
writeErrorResponse(w, s3Error, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
case authTypeSignedV2, authTypePresignedV2: |
|
|
|
|
s3Error := isReqAuthenticatedV2(r) |
|
|
|
|
if s3Error != ErrNone { |
|
|
|
|
errorIf(errSignatureMismatch, "%s", dumpRequest(r)) |
|
|
|
|
writeErrorResponse(w, s3Error, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
case authTypePresigned, authTypeSigned: |
|
|
|
|
if s3Error := reqSignatureV4Verify(r, globalServerConfig.GetRegion()); s3Error != ErrNone { |
|
|
|
|
errorIf(errSignatureMismatch, "%s", dumpRequest(r)) |
|
|
|
|
writeErrorResponse(w, s3Error, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|