# HG changeset patch # User Ruslan Ermilov # Date 1576498741 -10800 # Node ID c1a7d36726536691946c2bc243d030e041fa6e74 # Parent 3939483cd1b56b202a99b1db344d9568b0958e67 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. diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c --- a/src/http/modules/ngx_http_dav_module.c +++ b/src/http/modules/ngx_http_dav_module.c @@ -513,7 +513,6 @@ ngx_http_dav_mkcol_handler(ngx_http_requ } *(p - 1) = '\0'; - r->uri.len--; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http mkcol path: \"%s\"", path.data); @@ -521,6 +520,8 @@ ngx_http_dav_mkcol_handler(ngx_http_requ if (ngx_create_dir(path.data, ngx_dir_access(dlcf->access)) != NGX_FILE_ERROR) { + *(p - 1) = '/'; + if (ngx_http_dav_location(r, path.data) != NGX_OK) { return NGX_HTTP_INTERNAL_SERVER_ERROR; }