Fix a http dav module mkcol response problem

The response of http dav module on mkcol request has a problem. The
“Location” header has a ‘\0’ . This will cause some client wait to
timeout.

e.g.
Location: http://localhost/path/created\0\r\n

I found in “ngx_http_dav_mkcol_handler” , after remove the tail ‘/’ , it
does not reduse the length of the uri.

patch:

*** ngx_http_dav_module.c.bak 2009-09-28 15:00:59.000000000 +0800
— ngx_http_dav_module.c 2009-09-28 16:06:12.000000000 +0800
*************** ngx_http_dav_mkcol_handler(ngx_http_requ
*** 490,496 ****
p = ngx_http_map_uri_to_path(r, &path, &root, 0);

  *(p - 1) = '\0';

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

— 490,496 ----
p = ngx_http_map_uri_to_path(r, &path, &root, 0);

  *(p - 1) = '\0';

! r->uri.len-= 1; /* reduce uri length */
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
“http mkcol path: "%s"”, path.data);

Posted at Nginx Forum: