538 pblock_nvinsert("content-length", "0", rq->srvhdrs); |
538 pblock_nvinsert("content-length", "0", rq->srvhdrs); |
539 protocol_status(sn, rq, 201, NULL); |
539 protocol_status(sn, rq, 201, NULL); |
540 protocol_start_response(sn, rq); |
540 protocol_start_response(sn, rq); |
541 ret = REQ_PROCEED; |
541 ret = REQ_PROCEED; |
542 } else { |
542 } else { |
543 int status_code = 500; |
543 if(rq->status_num <= 0) { |
544 if(op->vfs->vfs_errno == EEXIST) { |
544 int status_code = 500; |
545 // 405 (Method Not Allowed) - MKCOL can only be executed on an unmapped URL. |
545 if(op->vfs->vfs_errno == EEXIST) { |
546 status_code = 405; |
546 // 405 (Method Not Allowed) - MKCOL can only be executed on an unmapped URL. |
547 } else if(op->vfs->vfs_errno == ENOENT) { |
547 status_code = 405; |
548 // 409 (Conflict) - A collection cannot be made at the Request-URI until |
548 } else if(op->vfs->vfs_errno == ENOENT) { |
549 // one or more intermediate collections have been created. The server |
549 // 409 (Conflict) - A collection cannot be made at the Request-URI until |
550 // MUST NOT create those intermediate collections automatically. |
550 // one or more intermediate collections have been created. The server |
551 status_code = 409; |
551 // MUST NOT create those intermediate collections automatically. |
552 } |
552 status_code = 409; |
553 protocol_status(sn, rq, status_code, NULL); |
553 } |
|
554 protocol_status(sn, rq, status_code, NULL); |
|
555 } |
|
556 |
554 } |
557 } |
555 |
558 |
556 return ret; |
559 return ret; |
557 } |
560 } |
558 |
561 |