From 95f318e069a0642f8eaa642b2b71e3b235b07724 Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Mon, 26 Oct 2020 15:06:02 +0800 Subject: [PATCH] Feat: adapt minio for S3 policy and fix listing files --- assets | 2 +- models/policy.go | 2 +- pkg/filesystem/driver/s3/handler.go | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/assets b/assets index f342a2a..8ec4514 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit f342a2a7774c5163f8d5a6760b556b69d6fe498f +Subproject commit 8ec4514b7690eef20b283c1f00ee2d921f19ae7d diff --git a/models/policy.go b/models/policy.go index f8255df..61fd171 100644 --- a/models/policy.go +++ b/models/policy.go @@ -52,7 +52,7 @@ type PolicyOption struct { OdRedirect string `json:"od_redirect,omitempty"` // Region 区域代码 - Region string `json:"region"` + Region string `json:"region,omitempty"` } var thumbSuffix = map[string][]string{ diff --git a/pkg/filesystem/driver/s3/handler.go b/pkg/filesystem/driver/s3/handler.go index 9ebf951..4cf44e2 100644 --- a/pkg/filesystem/driver/s3/handler.go +++ b/pkg/filesystem/driver/s3/handler.go @@ -87,10 +87,9 @@ func (handler Driver) List(ctx context.Context, base string, recursive bool) ([] } opt := &s3.ListObjectsInput{ - Bucket: &handler.Policy.BucketName, - Prefix: &base, - EncodingType: aws.String(""), - MaxKeys: aws.Int64(1000), + Bucket: &handler.Policy.BucketName, + Prefix: &base, + MaxKeys: aws.Int64(1000), } // 是否为递归列出