Skip to content

Commit 5df5cc1

Browse files
committed
handler: Remove Space from attribute
Amazon s3 works perfectly without xmlns Closes #1074. Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
1 parent 30f920c commit 5df5cc1

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

api/data/info.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type (
9292

9393
// CORSConfiguration stores CORS configuration of a request.
9494
CORSConfiguration struct {
95-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CORSConfiguration" json:"-"`
95+
XMLName xml.Name `xml:"CORSConfiguration" json:"-"`
9696
CORSRules []CORSRule `xml:"CORSRule" json:"CORSRules"`
9797
}
9898

api/data/locking.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
type (
99
ObjectLockConfiguration struct {
10-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ObjectLockConfiguration" json:"-"`
10+
XMLName xml.Name `xml:"ObjectLockConfiguration" json:"-"`
1111
ObjectLockEnabled string `xml:"ObjectLockEnabled" json:"ObjectLockEnabled"`
1212
Rule *ObjectLockRule `xml:"Rule" json:"Rule"`
1313
}
@@ -23,12 +23,12 @@ type (
2323
}
2424

2525
LegalHold struct {
26-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LegalHold" json:"-"`
26+
XMLName xml.Name `xml:"LegalHold" json:"-"`
2727
Status string `xml:"Status" json:"Status"`
2828
}
2929

3030
Retention struct {
31-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Retention" json:"-"`
31+
XMLName xml.Name `xml:"Retention" json:"-"`
3232
Mode string `xml:"Mode" json:"Mode"`
3333
RetainUntilDate string `xml:"RetainUntilDate" json:"RetainUntilDate"`
3434
}

api/handler/multipart_upload.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ type (
7676
}
7777

7878
CompleteMultipartUpload struct {
79-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CompleteMultipartUpload"`
79+
XMLName xml.Name `xml:"CompleteMultipartUpload"`
8080
Parts []*layer.CompletedPart `xml:"Part"`
8181
}
8282

api/handler/notifications.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type (
2626
}
2727

2828
NotificationConfiguration struct {
29-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ NotificationConfiguation"`
29+
XMLName xml.Name `xml:"NotificationConfiguation"`
3030
NotificationConfiguration data.NotificationConfiguration
3131
}
3232
)

api/handler/put.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const (
177177
)
178178

179179
type createBucketParams struct {
180-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CreateBucketConfiguration" json:"-"`
180+
XMLName xml.Name `xml:"CreateBucketConfiguration" json:"-"`
181181
LocationConstraint string
182182
}
183183

api/handler/response.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type Bucket struct {
5757

5858
// AccessControlPolicy contains ACL.
5959
type AccessControlPolicy struct {
60-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ AccessControlPolicy" json:"-"`
60+
XMLName xml.Name `xml:"AccessControlPolicy" json:"-"`
6161
Owner Owner
6262
AccessControlList []*Grant `xml:"AccessControlList>Grant"`
6363
}
@@ -251,14 +251,14 @@ type ListObjectsVersionsResponse struct {
251251

252252
// VersioningConfiguration contains VersioningConfiguration XML representation.
253253
type VersioningConfiguration struct {
254-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ VersioningConfiguration"`
254+
XMLName xml.Name `xml:"VersioningConfiguration"`
255255
Status string `xml:"Status,omitempty"`
256256
MfaDelete string `xml:"MfaDelete,omitempty"`
257257
}
258258

259259
// Tagging contains tag set.
260260
type Tagging struct {
261-
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Tagging"`
261+
XMLName xml.Name `xml:"Tagging"`
262262
TagSet []Tag `xml:"TagSet>Tag"`
263263
}
264264

api/handler/response_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestAccessControlPolicyXML(t *testing.T) {
1414
// https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html
1515
var policyTemplate = `
1616
<?xml version="1.0" encoding="UTF-8"?>
17-
<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
17+
<AccessControlPolicy>
1818
<Owner>
1919
<ID>%[1]s</ID>
2020
<DisplayName>display-name</DisplayName>

0 commit comments

Comments
 (0)