From e16b362072e6be69195d56fb6f07c91fecc9dd9d Mon Sep 17 00:00:00 2001 From: Steven Feltner Date: Wed, 24 Aug 2016 21:59:56 -0700 Subject: [PATCH] TS-4725: Remove proxy.config.http.enable_url_expandomatic --- doc/admin-guide/files/records.config.en.rst | 13 ------- .../admin-guide/files/records.config.en.po | 8 ---- lib/perl/lib/Apache/TS/AdminClient.pm | 1 - mgmt/RecordsConfig.cc | 2 - proxy/http/HttpConfig.cc | 4 -- proxy/http/HttpConfig.h | 2 - proxy/http/HttpTransact.cc | 39 +------------------ tools/traffic_shell.pl | 3 +- 8 files changed, 2 insertions(+), 70 deletions(-) diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst index 72bce0f8c79..10852e8bbb4 100644 --- a/doc/admin-guide/files/records.config.en.rst +++ b/doc/admin-guide/files/records.config.en.rst @@ -882,13 +882,6 @@ ip-resolve ``1`` ``Age`` header is added. ===== ====================================================================== -.. ts:cv:: CONFIG proxy.config.http.enable_url_expandomatic INT 0 - :reloadable: - - Enables (``1``) or disables (``0``) ``.com`` domain expansion. This configures the Traffic Server to resolve unqualified hostnames by - prepending with ``www.`` and appending with ``.com`` before redirecting to the expanded address. For example: if a client makes - a request to ``host``, then Traffic Server redirects the request to ``www.host.com``. - .. ts:cv:: CONFIG proxy.config.http.chunking_enabled INT 1 :reloadable: :overridable: @@ -2293,12 +2286,6 @@ DNS Traffic Server to add the hostname extension .org, then specify ``org`` as the value for this variable (Traffic Server automatically adds the dot (.)). -.. note:: - - If the variable :ts:cv:`proxy.config.http.enable_url_expandomatic` is set to ``1`` (the default value), then you do not have to - add ``www.`` and ``.com`` to this list because Traffic Server automatically tries www. and .com after trying the values - you've specified. - .. ts:cv:: CONFIG proxy.config.dns.resolv_conf STRING /etc/resolv.conf Allows to specify which ``resolv.conf`` file to use for finding resolvers. While the format of this file must be the same as the diff --git a/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po b/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po index 8c6a6fcba9f..4d15363fe73 100644 --- a/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po +++ b/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po @@ -3610,14 +3610,6 @@ msgid "" "variable (Traffic Server automatically adds the dot (.))." msgstr "" -#: ../../../admin-guide/files/records.config.en.rst:2272 -msgid "" -"If the variable :ts:cv:`proxy.config.http.enable_url_expandomatic` is set " -"to ``1`` (the default value), then you do not have to add ``www.`` and ``." -"com`` to this list because Traffic Server automatically tries www. and .com " -"after trying the values you've specified." -msgstr "" - #: ../../../admin-guide/files/records.config.en.rst:2278 msgid "" "Allows to specify which ``resolv.conf`` file to use for finding resolvers. " diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm index 72cf0a4d1a6..889a3d34092 100644 --- a/lib/perl/lib/Apache/TS/AdminClient.pm +++ b/lib/perl/lib/Apache/TS/AdminClient.pm @@ -501,7 +501,6 @@ The Apache Traffic Server Administration Manual will explain what these strings proxy.config.http.enabled proxy.config.http.enable_http_info proxy.config.http.enable_http_stats - proxy.config.http.enable_url_expandomatic proxy.config.http.errors.log_error_pages proxy.config.http.forward.proxy_auth_to_parent proxy.config.http.global_user_agent_header diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 3498e1582f5..b4520c4961c 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -403,8 +403,6 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.http.response_server_str", RECD_STRING, "ATS/" PACKAGE_VERSION, RECU_DYNAMIC, RR_NULL, RECC_NULL, ".*", RECA_NULL} , - {RECT_CONFIG, "proxy.config.http.enable_url_expandomatic", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL} - , {RECT_CONFIG, "proxy.config.http.no_dns_just_forward_to_parent", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL} , {RECT_CONFIG, "proxy.config.http.uncacheable_requests_bypass_parent", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL} diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc index 7fd284040b2..de7e0e26780 100644 --- a/proxy/http/HttpConfig.cc +++ b/proxy/http/HttpConfig.cc @@ -902,8 +902,6 @@ HttpConfig::startup() HttpEstablishStaticConfigByte(c.use_client_source_port, "proxy.config.http.use_client_source_port"); HttpEstablishStaticConfigByte(c.oride.maintain_pristine_host_hdr, "proxy.config.url_remap.pristine_host_hdr"); - HttpEstablishStaticConfigByte(c.enable_url_expandomatic, "proxy.config.http.enable_url_expandomatic"); - HttpEstablishStaticConfigByte(c.oride.insert_request_via_string, "proxy.config.http.insert_request_via_str"); HttpEstablishStaticConfigByte(c.oride.insert_response_via_string, "proxy.config.http.insert_response_via_str"); HttpEstablishStaticConfigLongLong(c.oride.proxy_response_hsts_max_age, "proxy.config.ssl.hsts_max_age"); @@ -1175,8 +1173,6 @@ HttpConfig::reconfigure() params->origin_min_keep_alive_connections = params->oride.origin_max_connections; } - params->enable_url_expandomatic = INT_TO_BOOL(m_master.enable_url_expandomatic); - params->oride.insert_request_via_string = m_master.oride.insert_request_via_string; params->oride.insert_response_via_string = m_master.oride.insert_response_via_string; params->proxy_request_via_string = ats_strdup(m_master.proxy_request_via_string); diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h index aae60abc921..1fdc126b58a 100644 --- a/proxy/http/HttpConfig.h +++ b/proxy/http/HttpConfig.h @@ -726,7 +726,6 @@ struct HttpConfigParams : public ConfigInfo { MgmtByte disable_ssl_parenting; - MgmtByte enable_url_expandomatic; MgmtByte no_dns_forward_to_parent; MgmtByte no_origin_server_dns; MgmtByte use_client_target_addr; @@ -939,7 +938,6 @@ inline HttpConfigParams::HttpConfigParams() origin_min_keep_alive_connections(0), max_websocket_connections(-1), disable_ssl_parenting(0), - enable_url_expandomatic(0), no_dns_forward_to_parent(0), no_origin_server_dns(0), use_client_target_addr(0), diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index ff4c1977657..bb52db19395 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -1734,7 +1734,6 @@ HttpTransact::OSDNSLookup(State *s) } else { if (host_name_expansion == EXPANSION_NOT_ALLOWED) { // config file doesn't allow automatic expansion of host names - HTTP_RELEASE_ASSERT(!(s->http_config_param->enable_url_expandomatic)); DebugTxn("http_seq", "[HttpTransact::OSDNSLookup] DNS Lookup unsuccessful"); } else if (host_name_expansion == EXPANSION_FAILED) { // not able to expand the hostname. dns lookup failed @@ -6675,46 +6674,10 @@ HttpTransact::process_quick_http_filter(State *s, int method) HttpTransact::HostNameExpansionError_t HttpTransact::try_to_expand_host_name(State *s) { - static int max_dns_lookups = 2 + s->http_config_param->num_url_expansions; - static int last_expansion = max_dns_lookups - 2; - HTTP_RELEASE_ASSERT(!s->dns_info.lookup_success); if (s->dns_info.looking_up == ORIGIN_SERVER) { - /////////////////////////////////////////////////// - // if resolving dns of the origin server failed, // - // we try to expand hostname. // - /////////////////////////////////////////////////// - if (s->http_config_param->enable_url_expandomatic) { - int attempts = s->dns_info.attempts; - ink_assert(attempts >= 1 && attempts <= max_dns_lookups); - - if (attempts < max_dns_lookups) { - // Try a URL expansion - if (attempts <= last_expansion) { - char *expansion = s->http_config_param->url_expansions[attempts - 1]; - int length = strlen(s->server_info.name) + strlen(expansion) + 1; - - s->dns_info.lookup_name = s->arena.str_alloc(length); - ink_string_concatenate_strings_n(s->dns_info.lookup_name, length + 1, s->server_info.name, ".", expansion, NULL); - } else { - if (ParseRules::strchr(s->server_info.name, '.')) { - // don't expand if contains '.' - return (EXPANSION_FAILED); - } - // Try www..com - int length = strlen(s->server_info.name) + 8; - - s->dns_info.lookup_name = s->arena.str_alloc(length); - ink_string_concatenate_strings_n(s->dns_info.lookup_name, length + 1, "www.", s->server_info.name, ".com", NULL); - } - return RETRY_EXPANDED_NAME; - } else { - return DNS_ATTEMPTS_EXHAUSTED; - } - } else { - return EXPANSION_NOT_ALLOWED; - } + return EXPANSION_NOT_ALLOWED; } else { ////////////////////////////////////////////////////// // we looked up dns of parent proxy, but it failed, // diff --git a/tools/traffic_shell.pl b/tools/traffic_shell.pl index 306cd70fdf5..65d03d67ada 100755 --- a/tools/traffic_shell.pl +++ b/tools/traffic_shell.pl @@ -237,10 +237,9 @@ sub show_cluster { # sub show_dns_resolver { my $dns_search_default_domains = get_on_off("proxy.config.dns.search_default_domains"); - my $http_enable_url_expandomatic = get_on_off("proxy.config.http.enable_url_expandomatic"); + print <<__EOF Local Domain Expansion -- $dns_search_default_domains -.com Domain Expansion --- $http_enable_url_expandomatic __EOF }