Skip to content

Commit

Permalink
filer: return http status 499 for client closed connection
Browse files Browse the repository at this point in the history
fix #1684
  • Loading branch information
chrislusf committed Dec 16, 2020
1 parent 8cb6795 commit b789767
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion weed/server/filer_server_handlers_write_autochunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r *
reply, md5bytes, err = fs.doPutAutoChunk(ctx, w, r, chunkSize, so)
}
if err != nil {
writeJsonError(w, r, http.StatusInternalServerError, err)
if strings.HasPrefix(err.Error(), "read input:") {
writeJsonError(w, r, 499, err)
} else {
writeJsonError(w, r, http.StatusInternalServerError, err)
}
} else if reply != nil {
if len(md5bytes) > 0 {
w.Header().Set("Content-MD5", util.Base64Encode(md5bytes))
Expand Down

0 comments on commit b789767

Please sign in to comment.