1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

Follow up to r1879080: rename ProxyMappingDecoded to ProxyUseOriginalURI.

Same for proxy_dir_conf field.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879094 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2020-06-22 20:00:23 +00:00
parent d8848084e3
commit 6917e54aad
2 changed files with 12 additions and 11 deletions

View File

@@ -936,7 +936,7 @@ PROXY_DECLARE(int) ap_proxy_trans_match(request_rec *r, struct proxy_alias *ent,
* might consider for instance that an original %3B is a delimiter * might consider for instance that an original %3B is a delimiter
* for path parameters (which is not). * for path parameters (which is not).
*/ */
if (!dconf->mapping_decoded if (dconf->use_original_uri > 0
&& (ent->flags & PROXYPASS_MAPPING_SERVLET)) { && (ent->flags & PROXYPASS_MAPPING_SERVLET)) {
nocanon = 0; /* ignored since servlet's normalization applies */ nocanon = 0; /* ignored since servlet's normalization applies */
len = alias_match_servlet(r->pool, r->uri, fake); len = alias_match_servlet(r->pool, r->uri, fake);
@@ -1019,10 +1019,10 @@ static int proxy_trans(request_rec *r, int pre_trans)
dconf = ap_get_module_config(r->per_dir_config, &proxy_module); dconf = ap_get_module_config(r->per_dir_config, &proxy_module);
/* Do the work from the hook corresponding to the ProxyMappingDecoded /* Do the work from the hook corresponding to the ProxyUseOriginalURI
* configuration (on/default: translate hook, off: pre_translate hook). * configuration (on/default: translate hook, off: pre_translate hook).
*/ */
if (pre_trans ^ !dconf->mapping_decoded) { if (pre_trans ^ (dconf->use_original_uri > 0)) {
return DECLINED; return DECLINED;
} }
@@ -1813,7 +1813,7 @@ static void *create_proxy_dir_config(apr_pool_t *p, char *dummy)
new->add_forwarded_headers_set = 0; new->add_forwarded_headers_set = 0;
new->forward_100_continue = 1; new->forward_100_continue = 1;
new->forward_100_continue_set = 0; new->forward_100_continue_set = 0;
new->mapping_decoded = -1; /* unset (on by default) */ new->use_original_uri = -1; /* unset (off by default) */
return (void *) new; return (void *) new;
} }
@@ -1872,8 +1872,9 @@ static void *merge_proxy_dir_config(apr_pool_t *p, void *basev, void *addv)
new->forward_100_continue_set = add->forward_100_continue_set new->forward_100_continue_set = add->forward_100_continue_set
|| base->forward_100_continue_set; || base->forward_100_continue_set;
new->mapping_decoded = (add->mapping_decoded == -1) ? base->mapping_decoded new->use_original_uri = (add->use_original_uri == -1)
: add->mapping_decoded; ? base->use_original_uri
: add->use_original_uri;
return new; return new;
} }
@@ -3026,9 +3027,9 @@ static const command_rec proxy_cmds[] =
AP_INIT_FLAG("Proxy100Continue", forward_100_continue, NULL, RSRC_CONF|ACCESS_CONF, AP_INIT_FLAG("Proxy100Continue", forward_100_continue, NULL, RSRC_CONF|ACCESS_CONF,
"on if 100-Continue should be forwarded to the origin server, off if the " "on if 100-Continue should be forwarded to the origin server, off if the "
"proxy should handle it by itself"), "proxy should handle it by itself"),
AP_INIT_FLAG("ProxyMappingDecoded", ap_set_flag_slot_char, AP_INIT_FLAG("ProxyUseOriginalURI", ap_set_flag_slot_char,
(void*)APR_OFFSETOF(proxy_dir_conf, mapping_decoded), RSRC_CONF|ACCESS_CONF, (void*)APR_OFFSETOF(proxy_dir_conf, use_original_uri), RSRC_CONF|ACCESS_CONF,
"Whether to percent-decode before URI-path mapping"), "Whether to use the original/encoded URI-path for mapping"),
{NULL} {NULL}
}; };

View File

@@ -245,8 +245,8 @@ typedef struct {
apr_array_header_t *error_override_codes; apr_array_header_t *error_override_codes;
/** Whether to map percent-decoded URI-path */ /** Whether to use original/encoded URI-path or not (default) */
char mapping_decoded; char use_original_uri;
} proxy_dir_conf; } proxy_dir_conf;
/* if we interpolate env vars per-request, we'll need a per-request /* if we interpolate env vars per-request, we'll need a per-request