diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-04-01 16:13:29 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-04-01 16:13:29 -0700 |
| commit | 78b9db34d5a3b491221a8ad6f4fd7eab0498e3f9 (patch) | |
| tree | e5335784be43d023719f731c50a4536277dbf32c | |
| parent | 2a52e70a41cd1a196a43fe196960d9ed9d25f43d (diff) | |
| download | seaweedfs-78b9db34d5a3b491221a8ad6f4fd7eab0498e3f9.tar.xz seaweedfs-78b9db34d5a3b491221a8ad6f4fd7eab0498e3f9.zip | |
weed s3: generate time format acceptable by aws cli s3
fix https://github.com/chrislusf/seaweedfs/issues/911
| -rw-r--r-- | weed/s3api/custom_types.go | 3 | ||||
| -rw-r--r-- | weed/s3api/s3api_objects_list_handlers.go | 6 | ||||
| -rw-r--r-- | weed/s3api/s3api_xsd_generated.go | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/weed/s3api/custom_types.go b/weed/s3api/custom_types.go new file mode 100644 index 000000000..569dfc3ac --- /dev/null +++ b/weed/s3api/custom_types.go @@ -0,0 +1,3 @@ +package s3api + +const s3TimeFormat = "2006-01-02T15:04:05.999Z07:00" diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index a685802d2..fd20ebe3c 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -131,8 +131,8 @@ func (s3a *S3ApiServer) listFilerEntries(ctx context.Context, bucket, originalPr ETag: "\"" + filer2.ETag(entry.Chunks) + "\"", Size: int64(filer2.TotalSize(entry.Chunks)), Owner: CanonicalUser{ - ID: "bcaf161ca5fb16fd081034f", - DisplayName: "webfile", + ID: fmt.Sprintf("%x", entry.Attributes.Uid), + DisplayName: entry.Attributes.UserName, }, StorageClass: "STANDARD", }) @@ -151,7 +151,7 @@ func (s3a *S3ApiServer) listFilerEntries(ctx context.Context, bucket, originalPr CommonPrefixes: commonPrefixes, } - glog.V(4).Infof("read directory: %v, found: %v", request, counter) + glog.V(4).Infof("read directory: %v, found: %v, %+v", request, counter, response) return nil }) diff --git a/weed/s3api/s3api_xsd_generated.go b/weed/s3api/s3api_xsd_generated.go index e678ecf0d..573c09ede 100644 --- a/weed/s3api/s3api_xsd_generated.go +++ b/weed/s3api/s3api_xsd_generated.go @@ -966,10 +966,10 @@ func (b xsdBase64Binary) MarshalText() ([]byte, error) { type xsdDateTime time.Time func (t *xsdDateTime) UnmarshalText(text []byte) error { - return _unmarshalTime(text, (*time.Time)(t), "2006-01-02T15:04:05.999999999") + return _unmarshalTime(text, (*time.Time)(t), s3TimeFormat) } func (t xsdDateTime) MarshalText() ([]byte, error) { - return []byte((time.Time)(t).Format("2006-01-02T15:04:05.999999999")), nil + return []byte((time.Time)(t).Format(s3TimeFormat)), nil } func (t xsdDateTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error { if (time.Time)(t).IsZero() { |
