mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
Verify if request date is 5minutes late, reject such a request as
it could be a possible replay attack. This commit also fixes #505, by returning MethodNotAllowed instead of NotImplemented
This commit is contained in:
+8
-1
@@ -51,6 +51,7 @@ const (
|
||||
InvalidBucketName
|
||||
InvalidDigest
|
||||
InvalidRange
|
||||
InvalidRequest
|
||||
MalformedXML
|
||||
MissingContentLength
|
||||
MissingRequestBodyError
|
||||
@@ -61,11 +62,12 @@ const (
|
||||
RequestTimeTooSkewed
|
||||
SignatureDoesNotMatch
|
||||
TooManyBuckets
|
||||
MethodNotAllowed
|
||||
)
|
||||
|
||||
// Error codes, non exhaustive list - standard HTTP errors
|
||||
const (
|
||||
NotAcceptable = iota + 21
|
||||
NotAcceptable = iota + 23
|
||||
)
|
||||
|
||||
// Error code to Error structure map
|
||||
@@ -175,6 +177,11 @@ var errorCodeResponse = map[int]Error{
|
||||
Description: "You have attempted to create more buckets than allowed.",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
MethodNotAllowed: {
|
||||
Code: "MethodNotAllowed",
|
||||
Description: "The specified method is not allowed against this resource.",
|
||||
HTTPStatusCode: http.StatusMethodNotAllowed,
|
||||
},
|
||||
NotAcceptable: {
|
||||
Code: "NotAcceptable",
|
||||
Description: "The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.",
|
||||
|
||||
Reference in New Issue
Block a user