You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by el...@apache.org on 2018/03/06 20:38:30 UTC

[incubator-trafficcontrol] 01/02: Modify profile_cache_dot_config and server_cache_dot_config to support ports with never-cache

This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 842e115483d8282e01bdb8568302a70b678ecf94
Author: Matt Mills <mm...@2bn.net>
AuthorDate: Tue Mar 6 07:53:13 2018 -0700

    Modify profile_cache_dot_config and server_cache_dot_config to support ports with never-cache
---
 traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
index b1bd4d1..6a9992d 100755
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -1890,7 +1890,14 @@ sub server_cache_dot_config {
 		if ( $ds->{type} eq "HTTP_NO_CACHE" ) {
 			my $org_fqdn = $ds->{org};
 			$org_fqdn =~ s/https?:\/\///;
-			$text .= "dest_domain=" . $org_fqdn . " scheme=http action=never-cache\n";
+			$org_fqdn =~ m/.*?:(\d+).*/;
+			my $org_port = $1;
+
+			if (defined($org_port)) {
+				$text .= "dest_domain=" . $org_fqdn . " port=" . $org_port . " scheme=http action=never-cache\n";
+			} else {
+				$text .= "dest_domain=" . $org_fqdn . " scheme=http action=never-cache\n";
+			}
 		}
 	}
 
@@ -1918,7 +1925,14 @@ sub profile_cache_dot_config {
 		if ( $ds->{type} eq "HTTP_NO_CACHE" ) {
 			my $org_fqdn = $ds->{org};
 			$org_fqdn =~ s/https?:\/\///;
-			$text .= "dest_domain=" . $org_fqdn . " scheme=http action=never-cache\n";
+			$org_fqdn =~ m/.*?:(\d+).*/;
+			my $org_port = $1;
+			
+			if (defined($org_port)) {
+				$text .= "dest_domain=" . $org_fqdn . " port=" . $org_port . " scheme=http action=never-cache\n";
+			} else {
+				$text .= "dest_domain=" . $org_fqdn . " scheme=http action=never-cache\n";
+			}
 		}
 	}
 

-- 
To stop receiving notification emails like this one, please contact
elsloo@apache.org.