Repository: trafficserver Updated Branches: refs/heads/master e0c35aa8a -> 37ff55f7c
TS-2531: add a nohost_rule check for proxy request Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/37ff55f7 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/37ff55f7 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/37ff55f7 Branch: refs/heads/master Commit: 37ff55f7cacd99a021615ff36c98ee2ba8e6dbed Parents: e0c35aa Author: Bing W Wang <[email protected]> Authored: Tue Feb 25 15:25:29 2014 -0800 Committer: Bryan Call <[email protected]> Committed: Tue Feb 25 15:25:29 2014 -0800 ---------------------------------------------------------------------- CHANGES | 2 ++ proxy/http/remap/RemapProcessor.cc | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/37ff55f7/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index a4b08be..862933e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.0.0 + *) [TS-2531] The default remap rule doesn't match a forward proxy request + *) [TS-612] Add support for SSL keys with passphrases. Author: Ron Barber <[email protected]> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/37ff55f7/proxy/http/remap/RemapProcessor.cc ---------------------------------------------------------------------- diff --git a/proxy/http/remap/RemapProcessor.cc b/proxy/http/remap/RemapProcessor.cc index fc3c14c..ca74117 100644 --- a/proxy/http/remap/RemapProcessor.cc +++ b/proxy/http/remap/RemapProcessor.cc @@ -106,6 +106,14 @@ RemapProcessor::setup_for_remap(HttpTransact::State *s) mapping_found = rewrite_table->forwardMappingLookup(request_url, request_port, request_host, request_host_len, s->url_map); } + // If no rules match and we have a host, check empty host rules since + // they function as default rules for server requests. + // If there's no host, we've already done this. + if (!mapping_found && rewrite_table->nohost_rules && request_host_len) { + Debug("url_rewrite", "[lookup] nothing matched"); + mapping_found = rewrite_table->forwardMappingLookup(request_url, 0, "", 0, s->url_map); + } + if (!proxy_request) { // do extra checks on a server request // Save this information for later @@ -114,14 +122,6 @@ RemapProcessor::setup_for_remap(HttpTransact::State *s) s->hh_info.request_host = request_host; s->hh_info.request_port = request_port; - // If no rules match and we have a host, check empty host rules since - // they function as default rules for server requests. - // If there's no host, we've already done this. - if (!mapping_found && rewrite_table->nohost_rules && request_host_len) { - Debug("url_rewrite", "[lookup] nothing matched"); - mapping_found = rewrite_table->forwardMappingLookup(request_url, 0, "", 0, s->url_map); - } - if (mapping_found) { // Downstream mapping logic (e.g., self::finish_remap()) // apparently assumes the presence of the target in the URL, so
