Dav: restored the request URI on a destination mapping error.

The COPY and MOVE handler temporarily replaces r->uri with the
destination to map it to a path, restoring it only on success.  When
ngx_http_map_uri_to_path() failed for the destination, the handler
returned without restoring r->uri, leaving it set to the client-supplied
destination.  Later processing that derives a target from the request
URI, such as an error_page with a variable, then resolved against the
destination instead of the request target.
This commit is contained in:
Vadim Zhestikov 2026-09-17 10:23:21 -07:00 • committed by VadimZhestikov
parent 1f214f4158
commit 2b84cd7dd7

View file

@ -721,6 +721,7 @@ overwrite_done:
r->uri = duri;
if (ngx_http_map_uri_to_path(r, &copy.path, &root, 0) == NULL) {
r->uri = uri;
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}