Browse Source

#4270 set http status code to 409 if dir already exists (#4287)

pull/4292/head
Rohit Chormale 2 years ago
committed by GitHub
parent
commit
59706c89fb
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

@ -49,7 +49,7 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r *
if err != nil {
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") {
} else if strings.HasSuffix(err.Error(), "is a file") || strings.HasSuffix(err.Error(), "already exists") {
writeJsonError(w, r, http.StatusConflict, err)
} else {
writeJsonError(w, r, http.StatusInternalServerError, err)

Loading…
Cancel
Save