mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 04:30:26 +03:00
api: Requests should be differentiated if possible based on http router. (#2219)
In current master ListObjectsV2 was merged into ListObjectsHandler which also implements V1 API as well. Move the detection of ListObject types to its rightful place in http router.
This commit is contained in:
+14
-3
@@ -1153,9 +1153,8 @@ func (s *TestSuiteCommon) TestListObjectsHandlerErrors(c *C) {
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(response.StatusCode, Equals, http.StatusOK)
|
||||
|
||||
// create HTTP request with invalid value of max-keys parameter.
|
||||
// max-keys is set to -2.
|
||||
request, err = newTestSignedRequest("GET", getListObjectsURL(s.endPoint, bucketName, "-2"),
|
||||
// create listObjectsV1 request with invalid value of max-keys parameter. max-keys is set to -2.
|
||||
request, err = newTestSignedRequest("GET", getListObjectsV1URL(s.endPoint, bucketName, "-2"),
|
||||
0, nil, s.accessKey, s.secretKey)
|
||||
c.Assert(err, IsNil)
|
||||
client = http.Client{}
|
||||
@@ -1164,6 +1163,18 @@ func (s *TestSuiteCommon) TestListObjectsHandlerErrors(c *C) {
|
||||
c.Assert(err, IsNil)
|
||||
// validating the error response.
|
||||
verifyError(c, response, "InvalidArgument", "Argument maxKeys must be an integer between 0 and 2147483647", http.StatusBadRequest)
|
||||
|
||||
// create listObjectsV2 request with invalid value of max-keys parameter. max-keys is set to -2.
|
||||
request, err = newTestSignedRequest("GET", getListObjectsV2URL(s.endPoint, bucketName, "-2"),
|
||||
0, nil, s.accessKey, s.secretKey)
|
||||
c.Assert(err, IsNil)
|
||||
client = http.Client{}
|
||||
// execute the HTTP request.
|
||||
response, err = client.Do(request)
|
||||
c.Assert(err, IsNil)
|
||||
// validating the error response.
|
||||
verifyError(c, response, "InvalidArgument", "Argument maxKeys must be an integer between 0 and 2147483647", http.StatusBadRequest)
|
||||
|
||||
}
|
||||
|
||||
// TestPutBucketErrors - request for non valid bucket operation
|
||||
|
||||
Reference in New Issue
Block a user