diff options
author | Ruediger Pluem <rpluem@apache.org> | 2023-03-13 11:24:30 +0100 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2023-03-13 11:24:30 +0100 |
commit | 2fa15c2c06213dc516a5383faa4bce3c74b9286a (patch) | |
tree | c1e52339f902c0ef594e99cc55562f207adb5955 /modules/proxy/mod_proxy_http.c | |
parent | Stop dumping error_log on failure, since is is now captured (diff) | |
download | apache2-2fa15c2c06213dc516a5383faa4bce3c74b9286a.tar.xz apache2-2fa15c2c06213dc516a5383faa4bce3c74b9286a.zip |
Do not double encode encoded slashes
In case that AllowEncodedSlashes is set to NoDecode do not double encode
encoded slashes in the URL sent by the reverse proxy to the backend.
* include/ap_mmn.h: Document the addition of ap_proxy_canonenc_ex to the API.
* modules/proxy/mod_proxy.h: Declare ap_proxy_canonenc_ex and define flag
values.
* modules/proxy/proxy_util.c: Implement ap_proxy_canonenc_ex by modifying
ap_proxy_canonenc accordingly and reimplement ap_proxy_canonenc to
use ap_proxy_canonenc_ex with the appropriate flag.
* modules/http2/mod_proxy_http2.c, modules/proxy/mod_proxy_*.c: Set the
correct flag based on the AllowEncodedSlashes configuration and use
ap_proxy_canonenc_ex instead of ap_proxy_canonenc.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908341 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/mod_proxy_http.c')
-rw-r--r-- | modules/proxy/mod_proxy_http.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 1ec5fe1134..23c5b691f7 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -123,8 +123,11 @@ static int proxy_http_canon(request_rec *r, char *url) search = r->args; } else { - path = ap_proxy_canonenc(r->pool, url, strlen(url), - enc_path, 0, r->proxyreq); + core_dir_config *d = ap_get_core_module_config(r->per_dir_config); + int flags = d->allow_encoded_slashes && !d->decode_encoded_slashes ? PROXY_CANONENC_NOENCODEDSLASHENCODING : 0; + + path = ap_proxy_canonenc_ex(r->pool, url, strlen(url), enc_path, + flags, r->proxyreq); search = r->args; } if (search && *ap_scan_vchar_obstext(search)) { |