Skip to content

Commit

Permalink
Dav: fixed Location in successful MKCOL response.
Browse files Browse the repository at this point in the history
Instead of reducing URI length to not include the terminating '\0'
character in 6ddaac3e0bf7, restore the terminating '/' character.
  • Loading branch information
mdocguard committed Dec 16, 2019
1 parent 953f539 commit 6dc0c88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/http/modules/ngx_http_dav_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,15 @@ ngx_http_dav_mkcol_handler(ngx_http_request_t *r, ngx_http_dav_loc_conf_t *dlcf)
}

*(p - 1) = '\0';
r->uri.len--;

ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http mkcol path: \"%s\"", path.data);

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;
}
Expand Down

0 comments on commit 6dc0c88

Please sign in to comment.