From: Andre Malo Date: Tue, 18 Feb 2003 20:35:28 +0000 (+0000) Subject: Hook mod_proxy's fixup before mod_rewrite's fixup, so that by X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2610c4991e5a5f51068b186dabe869ab8c57ddb;p=apache Hook mod_proxy's fixup before mod_rewrite's fixup, so that by mod_rewrite proxied URLs will not be escaped accidentally by mod_proxy's fixup. PR: 16368 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98707 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 4149304a30..4d939855e8 100644 --- a/CHANGES +++ b/CHANGES @@ -2,10 +2,14 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) Hook mod_proxy's fixup before mod_rewrite's fixup, so that by + mod_rewrite proxied URLs will not be escaped accidentally by + mod_proxy's fixup. PR 16368 [André Malo] + *) While processing filters on internal redirects, remember seen EOS buckets also in the request structure of the redirect issuer(s). This - prevents filters (such as mod_deflate) to add garbage to the response. - PR 14451. [André Malo] + prevents filters (such as mod_deflate) from adding garbage to the + response. PR 14451. [André Malo] *) Allow restart of httpd to occur even with syntax errors in the config file. PR 16813. [Justin Erenkrantz] diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 6d99933f34..8ab25ea157 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -4357,6 +4357,11 @@ static const command_rec command_table[] = { static void register_hooks(apr_pool_t *p) { + /* fixup after mod_proxy, so that the proxied url will not + * escaped accidentally by mod_proxy's fixup. + */ + static const char * const aszPre[]={ "mod_proxy.c", NULL }; + APR_REGISTER_OPTIONAL_FN(ap_register_rewrite_mapfunc); ap_hook_handler(handler_redirect, NULL, NULL, APR_HOOK_MIDDLE); @@ -4364,7 +4369,7 @@ static void register_hooks(apr_pool_t *p) ap_hook_post_config(post_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init(init_child, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_fixups(hook_fixup, NULL, NULL, APR_HOOK_FIRST); + ap_hook_fixups(hook_fixup, aszPre, NULL, APR_HOOK_FIRST); ap_hook_translate_name(hook_uri2file, NULL, NULL, APR_HOOK_FIRST); ap_hook_type_checker(hook_mimetype, NULL, NULL, APR_HOOK_MIDDLE); } diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 695822de8a..b903578fad 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -1109,6 +1109,11 @@ static int proxy_post_config(apr_pool_t *pconf, apr_pool_t *plog, static void register_hooks(apr_pool_t *p) { + /* fixup before mod_rewrite, so that the proxied url will not + * escaped accidentally by our fixup. + */ + static const char * const aszSucc[]={ "mod_rewrite.c", NULL }; + /* handler */ ap_hook_handler(proxy_handler, NULL, NULL, APR_HOOK_FIRST); /* filename-to-URI translation */ @@ -1116,7 +1121,7 @@ static void register_hooks(apr_pool_t *p) /* walk entries and suppress default TRACE behavior */ ap_hook_map_to_storage(proxy_map_location, NULL,NULL, APR_HOOK_FIRST); /* fixups */ - ap_hook_fixups(proxy_fixup, NULL, NULL, APR_HOOK_FIRST); + ap_hook_fixups(proxy_fixup, NULL, aszSucc, APR_HOOK_FIRST); /* post read_request handling */ ap_hook_post_read_request(proxy_detect, NULL, NULL, APR_HOOK_FIRST); /* post config handling */