|
|
@ -26,9 +26,6 @@ func TestBucketService_GetWebsite(t *testing.T) { |
|
|
|
<RedirectAllRequestsTo> |
|
|
|
<Protocol>https</Protocol> |
|
|
|
</RedirectAllRequestsTo> |
|
|
|
<ErrorDocument> |
|
|
|
<Key>Error.html</Key> |
|
|
|
</ErrorDocument> |
|
|
|
<RoutingRules> |
|
|
|
<RoutingRule> |
|
|
|
<Condition> |
|
|
@ -69,8 +66,10 @@ func TestBucketService_GetWebsite(t *testing.T) { |
|
|
|
want := &BucketGetWebsiteResult{ |
|
|
|
XMLName: xml.Name{Local: "WebsiteConfiguration"}, |
|
|
|
Index: "index.html", |
|
|
|
RedirectProtocol: "https", |
|
|
|
Error: "Error.html", |
|
|
|
RedirectProtocol: &RedirectRequestsProtocol{ |
|
|
|
"https", |
|
|
|
}, |
|
|
|
RoutingRules: &WebsiteRoutingRules{ |
|
|
|
Rules: []WebsiteRoutingRule{ |
|
|
|
{ |
|
|
|
ConditionErrorCode: "404", |
|
|
@ -88,6 +87,7 @@ func TestBucketService_GetWebsite(t *testing.T) { |
|
|
|
RedirectReplaceKey: "demo.jpg", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
if !reflect.DeepEqual(res, want) { |
|
|
@ -101,9 +101,14 @@ func TestBucketService_PutWebsite(t *testing.T) { |
|
|
|
|
|
|
|
opt := &BucketPutWebsiteOptions{ |
|
|
|
Index: "index.html", |
|
|
|
RedirectProtocol: "https", |
|
|
|
Error: "Error.html", |
|
|
|
Rules: []WebsiteRoutingRule{ |
|
|
|
RedirectProtocol: &RedirectRequestsProtocol{ |
|
|
|
"https", |
|
|
|
}, |
|
|
|
Error: &ErrorDocument{ |
|
|
|
"Error.html", |
|
|
|
}, |
|
|
|
RoutingRules: &WebsiteRoutingRules{ |
|
|
|
[]WebsiteRoutingRule{ |
|
|
|
{ |
|
|
|
ConditionErrorCode: "404", |
|
|
|
RedirectProtocol: "https", |
|
|
@ -120,6 +125,7 @@ func TestBucketService_PutWebsite(t *testing.T) { |
|
|
|
RedirectReplaceKey: "demo.jpg", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
|
|
|