Browse Source

[s3] Replace code 500 to 499 for upload with ErrUnexpectedEOF (#3597)

pull/3599/head
Konstantin Lebedev 2 years ago
committed by GitHub
parent
commit
5307cadb32
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      weed/server/filer_server_handlers_write_autochunk.go

2
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)

Loading…
Cancel
Save