mirror of
https://github.com/minio/minio.git
synced 2025-01-23 12:43:16 -05:00
parent
ad779a8ba4
commit
409b4ddecb
@ -19,6 +19,7 @@ package main
|
||||
import (
|
||||
"encoding/xml"
|
||||
"net/http"
|
||||
"path"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -255,7 +256,7 @@ type DeleteObjectsResponse struct {
|
||||
|
||||
// getLocation get URL location.
|
||||
func getLocation(r *http.Request) string {
|
||||
return r.URL.Path
|
||||
return path.Clean(r.URL.Path) // Clean any trailing slashes.
|
||||
}
|
||||
|
||||
// getObjectLocation gets the relative URL for an object
|
||||
|
@ -1513,6 +1513,19 @@ func (s *MyAPIXLSuite) TestBucketMultipartList(c *C) {
|
||||
c.Assert(newResponse3.Bucket, Equals, "bucketmultipartlist")
|
||||
}
|
||||
|
||||
// TestMakeBucketLocation - tests make bucket location header response.
|
||||
func (s *MyAPIXLSuite) TestMakeBucketLocation(c *C) {
|
||||
request, err := s.newRequest("PUT", testAPIXLServer.URL+"/make-bucket-location", 0, nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
client := http.Client{}
|
||||
response, err := client.Do(request)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(response.StatusCode, Equals, 200)
|
||||
// Validate location header value equals proper bucket name.
|
||||
c.Assert(response.Header.Get("Location"), Equals, "/make-bucket-location")
|
||||
}
|
||||
|
||||
func (s *MyAPIXLSuite) TestValidateObjectMultipartUploadID(c *C) {
|
||||
request, err := s.newRequest("PUT", testAPIXLServer.URL+"/objectmultipartlist-uploadid", 0, nil)
|
||||
c.Assert(err, IsNil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user