]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
Merge r1891206, r1891216, r1891284 from trunk:
authorYann Ylavic <ylavic@apache.org>
Tue, 24 Aug 2021 12:44:28 +0000 (12:44 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 24 Aug 2021 12:44:28 +0000 (12:44 +0000)
commitbe99f85dba9a0b1993bec3f0dcf3b28732cea03c
treedc192fb09ba64442804b34ac486a52b11a2517f2
parent2d40f1203c06129e4e71a4c675cc1d5f87b1db42
Merge r1891206, r1891216, r1891284 from trunk:

mod_proxy: Fix possible reuse/merging of Proxy(Pass)Match workers.  PR 65419.

We can't truncate ProxyMatch's worker name/url to the first '$' substitution
without possibly colliding with other workers. This also makes the matching
done at runtime by ap_proxy_strcmp_ematch() completely pointless.

To fix this and still address r1878467 (i.e. make http://host:port$1 a "valid"
URL), we need to remove '$' substitutions from the :port part of the URL only
since it's allowed anywhere else by apr_uri_parse().

So let's strip them before apr_uri_parse() and prepend them back in the path
before apr_uri_unparse() to restore the original URL. Non-matchable workers are
not concerned so ap_proxy_define_worker() is made a local helper (w/o the ap_
prefix) which takes "matchable" as argument and can then be called by both
ap_proxy_define_[match_]worker() functions.

mod_proxy: Follow up to r1891206: fix UDS scheme.

mod_proxy: Avoid confusion of prefix/regex matching workers at loading.  PR 65429.

ap_proxy_get_worker() needs to know whether it should lookup for prefix or
match or both matching workers, depending on the context.

For instance <Proxy[Match]> or ProxyPass[Match] directives need to lookup for
an existing worker with the same type as the directive (*Match or not), because
they will define one with that matching type if none exists.

On the contrary, "ProxySet <url>" at load time or ap_proxy_pre_request() at run
time need to find a worker matching an url whether it's by prefix or by regex.

So this commit adds ap_proxy_get_worker_ex() which takes a bitmask for the
matching type and calls it appropriately where needed.

For consistency, ap_proxy_define_worker_ex() is also added, using the same
bitmask flags, deprecating ap_proxy_define_match_worker().

Follow up to r1891206.

Github: closes #261

Submitted by: ylavic
Reviewed by: ylavic, minfrin, icing

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1892569 13f79535-47bb-0310-9956-ffa450edef68
CHANGES
include/ap_mmn.h
modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_util.c