aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-09-05 19:47:43 +0500
committerGitHub <noreply@github.com>2022-09-05 07:47:43 -0700
commit5307cadb320b0ec58105cdc2d92d7c092723b279 (patch)
tree56dc4af18926c0094bb4fcc4129b34099cae4ac2
parent5b38f22e6ea2a27681d77b42c0d09620ae8d6966 (diff)
downloadseaweedfs-5307cadb320b0ec58105cdc2d92d7c092723b279.tar.xz
seaweedfs-5307cadb320b0ec58105cdc2d92d7c092723b279.zip
[s3] Replace code 500 to 499 for upload with ErrUnexpectedEOF (#3597)
-rw-r--r--weed/server/filer_server_handlers_write_autochunk.go2
1 files changed, 1 insertions, 1 deletions
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)