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