From 59706c89fb3d2ab325a36ef237e147f99d6d259e Mon Sep 17 00:00:00 2001 From: Rohit Chormale Date: Wed, 8 Mar 2023 21:15:08 +0530 Subject: [PATCH] #4270 set http status code to 409 if dir already exists (#4287) --- 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 8b3fc45fb..6732db195 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/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)