Skip to content

Commit d8f48ff

Browse files
authored
Fix mkcol on existing directory (#36)
1 parent bb31790 commit d8f48ff

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

rap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,9 +867,10 @@ static ssize_t mkcol(Message * requestMessage) {
867867
case ENOSPC:
868868
case EDQUOT:
869869
return writeErrorResponse(RAP_RESPOND_INSUFFICIENT_STORAGE, strerror(e), NULL, fileName);
870+
case EEXIST:
871+
return writeErrorResponse(RAP_RESPOND_METHOD_NOT_ALLOWED, strerror(e), NULL, fileName);
870872
case ENOENT:
871873
case EPERM:
872-
case EEXIST:
873874
case ENOTDIR:
874875
default:
875876
return writeErrorResponse(RAP_RESPOND_CONFLICT, strerror(e), NULL, fileName);

shared.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ typedef enum RapConstant {
4343
RAP_RESPOND_AUTH_FAILLED = 401,
4444
RAP_RESPOND_ACCESS_DENIED = 403,
4545
RAP_RESPOND_NOT_FOUND = 404,
46+
RAP_RESPOND_METHOD_NOT_ALLOWED = 405,
4647
RAP_RESPOND_CONFLICT = 409,
4748
RAP_RESPOND_URI_TOO_LARGE = 414,
4849
RAP_RESPOND_LOCKED = 423,

0 commit comments

Comments
 (0)