elsloo closed pull request #1968: Fixes #1915 to make http_no_cache services 
support origin ports
URL: https://github.com/apache/incubator-trafficcontrol/pull/1968
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm 
b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
index b1bd4d12f2..532c07200b 100755
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -1890,7 +1890,15 @@ 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 = $2;
+
+                       if (defined($org_port)) {
+                               $org_fqdn = $1;
+                               $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 +1926,15 @@ 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 = $2;
+                       
+                       if (defined($org_port)) {
+                               $org_fqdn = $1;
+                               $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";
+                       }
                }
        }
 
diff --git a/traffic_ops/app/lib/UI/ConfigFiles.pm 
b/traffic_ops/app/lib/UI/ConfigFiles.pm
index 27cc7e7d75..ae1c937fc3 100644
--- a/traffic_ops/app/lib/UI/ConfigFiles.pm
+++ b/traffic_ops/app/lib/UI/ConfigFiles.pm
@@ -1013,7 +1013,15 @@ sub cache_dot_config {
                if ( $remap->{type} eq "HTTP_NO_CACHE" ) {
                        my $org_fqdn = $remap->{org};
                        $org_fqdn =~ s/https?:\/\///;
-                       $text .= "dest_domain=" . $org_fqdn . " scheme=http 
action=never-cache\n";
+                       $org_fqdn =~ m/(.*?):(\d+).*/;
+                       my $org_port = $2;
+
+                       if (defined($org_port)) {
+                               $org_fqdn = $1;
+                               $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";
+                       }
                }
        }
        return $text;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to