From 51bcc219ea55b86077a6a921284530fb2de9d707 Mon Sep 17 00:00:00 2001 From: SmoothDenis Date: Sat, 22 Jul 2023 18:22:38 +0400 Subject: [PATCH] s3api should return 500 code from filer (#4699) --- weed/s3api/s3api_object_handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 33de2a13e..e959ff1f1 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -416,6 +416,11 @@ func (s3a *S3ApiServer) proxyToFiler(w http.ResponseWriter, r *http.Request, des return } + if resp.StatusCode == http.StatusInternalServerError { + s3err.WriteErrorResponse(w, r, s3err.ErrInternalError) + return + } + // when HEAD a directory, it should be reported as no such key // https://github.com/seaweedfs/seaweedfs/issues/3457 if resp.ContentLength == -1 && resp.StatusCode != http.StatusNotModified {