Merge pull request #1129 from harshavardhana/support-virtual-style-buckets
Support virtual styled buckets with signature v2
This commit is contained in:
+2
-2
@@ -48,8 +48,8 @@
|
||||
"canonical": "github.com/minio/minio-go-legacy",
|
||||
"comment": "",
|
||||
"local": "vendor/github.com/minio/minio-go-legacy",
|
||||
"revision": "afeb2695278bef4a6779c064156c9378b4736ecc",
|
||||
"revisionTime": "2015-09-22T23:27:13-07:00"
|
||||
"revision": "e1b64561ec279d041bfeef719458030fb8fd7c52",
|
||||
"revisionTime": "2015-09-24T11:38:07-07:00"
|
||||
},
|
||||
{
|
||||
"canonical": "github.com/minio/minio/pkg/probe",
|
||||
|
||||
-1
@@ -116,7 +116,6 @@ type ObjectStat struct {
|
||||
var regions = map[string]string{
|
||||
"s3-fips-us-gov-west-1.amazonaws.com": "us-gov-west-1",
|
||||
"s3.amazonaws.com": "us-east-1",
|
||||
"s3-external-1.amazonaws.com": "us-east-1",
|
||||
"s3-us-west-1.amazonaws.com": "us-west-1",
|
||||
"s3-us-west-2.amazonaws.com": "us-west-2",
|
||||
"s3-eu-west-1.amazonaws.com": "eu-west-1",
|
||||
|
||||
+19
-4
@@ -453,11 +453,26 @@ var resourceList = []string{
|
||||
// [ sub-resource, if present. For example "?acl", "?location", "?logging", or "?torrent"];
|
||||
func (r *request) writeCanonicalizedResource(buf *bytes.Buffer) error {
|
||||
requestURL := r.req.URL
|
||||
encodedURLPath, err := urlEncodeName(requestURL.Path)
|
||||
if err != nil {
|
||||
return err
|
||||
if r.config.isVirtualStyle {
|
||||
for k, v := range regions {
|
||||
if v == r.config.Region {
|
||||
path := "/" + strings.TrimSuffix(requestURL.Host, "."+k)
|
||||
path += requestURL.Path
|
||||
encodedURLPath, err := urlEncodeName(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
buf.WriteString(encodedURLPath)
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
encodedURLPath, err := urlEncodeName(requestURL.Path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
buf.WriteString(encodedURLPath)
|
||||
}
|
||||
buf.WriteString(encodedURLPath)
|
||||
sort.Strings(resourceList)
|
||||
if requestURL.RawQuery != "" {
|
||||
var n int
|
||||
|
||||
Reference in New Issue
Block a user