From c5705e7a35b4097a2026ad9da2fd5ca88a16492d Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev Date: Wed, 17 Mar 2021 23:40:42 +0500 Subject: [PATCH 1/2] dir + slash key does not exist https://github.com/chrislusf/seaweedfs/issues/1917 --- weed/s3api/s3api_object_handlers.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 2b6b80f90..56f50ddce 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -310,8 +310,7 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des return } defer util.CloseResponse(resp) - - if (resp.ContentLength == -1 || resp.StatusCode == 404) && !strings.HasSuffix(destUrl, "/") { + if resp.ContentLength == -1 || resp.StatusCode == 404 { if r.Method != "DELETE" { writeErrorResponse(w, s3err.ErrNoSuchKey, r.URL) return From bf94149920456cd0754c54b01a23015893406888 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev Date: Wed, 17 Mar 2021 23:41:34 +0500 Subject: [PATCH 2/2] add line --- weed/s3api/s3api_object_handlers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 56f50ddce..b3cfd9ec7 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -310,6 +310,7 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des return } defer util.CloseResponse(resp) + if resp.ContentLength == -1 || resp.StatusCode == 404 { if r.Method != "DELETE" { writeErrorResponse(w, s3err.ErrNoSuchKey, r.URL)