mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #3154 from kmlebedev/s3_test_invalid_range
This commit is contained in:
commit
4a5135961f
|
@ -353,6 +353,11 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if resp.StatusCode == http.StatusRequestedRangeNotSatisfiable {
|
||||||
|
s3err.WriteErrorResponse(w, r, s3err.ErrInvalidRange)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (resp.ContentLength == -1 || resp.StatusCode == 404) && resp.StatusCode != 304 {
|
if (resp.ContentLength == -1 || resp.StatusCode == 404) && resp.StatusCode != 304 {
|
||||||
if r.Method != "DELETE" {
|
if r.Method != "DELETE" {
|
||||||
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchKey)
|
s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchKey)
|
||||||
|
|
|
@ -64,6 +64,7 @@ const (
|
||||||
ErrInvalidMaxDeleteObjects
|
ErrInvalidMaxDeleteObjects
|
||||||
ErrInvalidPartNumberMarker
|
ErrInvalidPartNumberMarker
|
||||||
ErrInvalidPart
|
ErrInvalidPart
|
||||||
|
ErrInvalidRange
|
||||||
ErrInternalError
|
ErrInternalError
|
||||||
ErrInvalidCopyDest
|
ErrInvalidCopyDest
|
||||||
ErrInvalidCopySource
|
ErrInvalidCopySource
|
||||||
|
@ -370,6 +371,11 @@ var errorCodeResponse = map[ErrorCode]APIError{
|
||||||
Description: "Invalid Request",
|
Description: "Invalid Request",
|
||||||
HTTPStatusCode: http.StatusBadRequest,
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
},
|
},
|
||||||
|
ErrInvalidRange: {
|
||||||
|
Code: "InvalidRange",
|
||||||
|
Description: "The requested range is not satisfiable",
|
||||||
|
HTTPStatusCode: http.StatusRequestedRangeNotSatisfiable,
|
||||||
|
},
|
||||||
ErrAuthNotSetup: {
|
ErrAuthNotSetup: {
|
||||||
Code: "InvalidRequest",
|
Code: "InvalidRequest",
|
||||||
Description: "Signed request requires setting up SeaweedFS S3 authentication",
|
Description: "Signed request requires setting up SeaweedFS S3 authentication",
|
||||||
|
|
Loading…
Reference in a new issue