diff options
| author | Guo Lei <guol-fnst@fujitsu.com> | 2022-10-25 00:25:48 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-24 09:25:48 -0700 |
| commit | 97edb40275d68f659707207fddc97a920e3f9b63 (patch) | |
| tree | b840ab73541bb29b7516db764cef0f6f53c7e858 | |
| parent | d5364218b2d87b7bf91d9a7732efb7dac62b0b9b (diff) | |
| download | seaweedfs-97edb40275d68f659707207fddc97a920e3f9b63.tar.xz seaweedfs-97edb40275d68f659707207fddc97a920e3f9b63.zip | |
Fix errinfo (#3893)
* types packages is imported more than onece
* Fix error response when format of --expires is wrong.
It MUST be in RFC 1123 date format.
| -rw-r--r-- | weed/s3api/s3api_object_handlers.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 2fc0111a4..8c4e3f0e8 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -6,16 +6,17 @@ import ( "encoding/json" "encoding/xml" "fmt" - "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" - "github.com/seaweedfs/seaweedfs/weed/security" - "github.com/seaweedfs/seaweedfs/weed/util/mem" - "golang.org/x/exp/slices" "io" "net/http" "net/url" "strings" "time" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" + "github.com/seaweedfs/seaweedfs/weed/security" + "github.com/seaweedfs/seaweedfs/weed/util/mem" + "golang.org/x/exp/slices" + "github.com/pquerna/cachecontrol/cacheobject" "github.com/seaweedfs/seaweedfs/weed/filer" @@ -63,7 +64,7 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request) if r.Header.Get("Expires") != "" { if _, err = time.Parse(http.TimeFormat, r.Header.Get("Expires")); err != nil { - s3err.WriteErrorResponse(w, r, s3err.ErrMalformedExpires) + s3err.WriteErrorResponse(w, r, s3err.ErrMalformedDate) return } } |
