mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
api: Return NotImplemented for MultiDelete and CopyObject APIs
This commit is contained in:
parent
2ec211e52a
commit
ae6e774377
@ -238,6 +238,11 @@ func (h resourceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
writeErrorResponse(w, r, NotImplemented, r.URL.Path)
|
writeErrorResponse(w, r, NotImplemented, r.URL.Path)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// X-Amz-Copy-Source should be ignored as NotImplemented.
|
||||||
|
if _, ok := r.Header[http.CanonicalHeaderKey("x-amz-copy-source")]; ok {
|
||||||
|
writeErrorResponse(w, r, NotImplemented, r.URL.Path)
|
||||||
|
return
|
||||||
|
}
|
||||||
h.handler.ServeHTTP(w, r)
|
h.handler.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,6 +281,7 @@ var notimplementedBucketResourceNames = map[string]bool{
|
|||||||
"requestPayment": true,
|
"requestPayment": true,
|
||||||
"versioning": true,
|
"versioning": true,
|
||||||
"website": true,
|
"website": true,
|
||||||
|
"delete": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of not implemented object queries
|
// List of not implemented object queries
|
||||||
|
@ -508,6 +508,15 @@ func (s *MyAPIFSCacheSuite) TestNotImplemented(c *C) {
|
|||||||
response, err := client.Do(request)
|
response, err := client.Do(request)
|
||||||
c.Assert(err, IsNil)
|
c.Assert(err, IsNil)
|
||||||
c.Assert(response.StatusCode, Equals, http.StatusNotImplemented)
|
c.Assert(response.StatusCode, Equals, http.StatusNotImplemented)
|
||||||
|
|
||||||
|
request, err = s.newRequest("POST", testAPIFSCacheServer.URL+"/bucket/object", 0, nil)
|
||||||
|
request.Header.Set("X-Amz-Copy-Source", "/bucket/object-old")
|
||||||
|
c.Assert(err, IsNil)
|
||||||
|
|
||||||
|
client = http.Client{}
|
||||||
|
response, err = client.Do(request)
|
||||||
|
c.Assert(err, IsNil)
|
||||||
|
c.Assert(response.StatusCode, Equals, http.StatusNotImplemented)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MyAPIFSCacheSuite) TestHeader(c *C) {
|
func (s *MyAPIFSCacheSuite) TestHeader(c *C) {
|
||||||
|
Loading…
Reference in New Issue
Block a user