From 5307cadb320b0ec58105cdc2d92d7c092723b279 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Mon, 5 Sep 2022 19:47:43 +0500 Subject: [PATCH] [s3] Replace code 500 to 499 for upload with ErrUnexpectedEOF (#3597) --- weed/server/filer_server_handlers_write_autochunk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index a1dc9c8d6..89941b340 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -46,7 +46,7 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r * reply, md5bytes, err = fs.doPutAutoChunk(ctx, w, r, chunkSize, contentLength, so) } if err != nil { - if strings.HasPrefix(err.Error(), "read input:") { + if strings.HasPrefix(err.Error(), "read input:") || err.Error() == io.ErrUnexpectedEOF.Error() { writeJsonError(w, r, 499, err) } else if strings.HasSuffix(err.Error(), "is a file") { writeJsonError(w, r, http.StatusConflict, err)