Mercurial > hg > nginx
comparison src/http/modules/ngx_http_dav_module.c @ 7601:c1a7d3672653
Dav: fixed Location in successful MKCOL response.
Instead of reducing URI length to not include the terminating '\0'
character in 6ddaac3e0bf7, restore the terminating '/' character.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Mon, 16 Dec 2019 15:19:01 +0300 |
parents | bb40db0e380d |
children | b399246ea45d |
comparison
equal
deleted
inserted
replaced
7600:3939483cd1b5 | 7601:c1a7d3672653 |
---|---|
511 if (p == NULL) { | 511 if (p == NULL) { |
512 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 512 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
513 } | 513 } |
514 | 514 |
515 *(p - 1) = '\0'; | 515 *(p - 1) = '\0'; |
516 r->uri.len--; | |
517 | 516 |
518 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 517 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
519 "http mkcol path: \"%s\"", path.data); | 518 "http mkcol path: \"%s\"", path.data); |
520 | 519 |
521 if (ngx_create_dir(path.data, ngx_dir_access(dlcf->access)) | 520 if (ngx_create_dir(path.data, ngx_dir_access(dlcf->access)) |
522 != NGX_FILE_ERROR) | 521 != NGX_FILE_ERROR) |
523 { | 522 { |
523 *(p - 1) = '/'; | |
524 | |
524 if (ngx_http_dav_location(r, path.data) != NGX_OK) { | 525 if (ngx_http_dav_location(r, path.data) != NGX_OK) { |
525 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 526 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
526 } | 527 } |
527 | 528 |
528 return NGX_HTTP_CREATED; | 529 return NGX_HTTP_CREATED; |