You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/11/01 19:51:50 UTC

[2/3] incubator-trafficcontrol git commit: fix example URLs for HTTP deliverservices. This fixes TC-13

fix example URLs for HTTP deliverservices.  This fixes TC-13


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/46e423e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/46e423e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/46e423e5

Branch: refs/heads/master
Commit: 46e423e5cf795b3c8c93e5d3790513436d81a40a
Parents: e4d3698
Author: Dave Neuman <ne...@apache.org>
Authored: Tue Nov 1 12:38:13 2016 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Tue Nov 1 13:51:15 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/UI/DeliveryService.pm | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/46e423e5/traffic_ops/app/lib/UI/DeliveryService.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/UI/DeliveryService.pm b/traffic_ops/app/lib/UI/DeliveryService.pm
index 3efd334..a3fce79 100644
--- a/traffic_ops/app/lib/UI/DeliveryService.pm
+++ b/traffic_ops/app/lib/UI/DeliveryService.pm
@@ -133,30 +133,30 @@ sub get_example_urls {
 			}
 		}
 	}
-	else {
+	else { # TODO:  Is this necessary? Could this be consolidated?
 		foreach my $re ( @{$regexp_set} ) {
 			if ( $re->{type} eq 'HOST_REGEXP' ) {
 				my $host = $re->{pattern};
-				my $url;
+				my $http_url;
+				my $https_url;
 				$host =~ s/\\//g;
 				$host =~ s/\.\*//g;
 				$host =~ s/\.//g;
-				my $p =
-					defined( $example_urls[ $re->{set_number} ] )
-					? $example_urls[ $re->{set_number} ]
-					: "";
+
 				if ( $re->{set_number} == 0 ) {
-					$example_urls[ $re->{set_number} ] = $scheme . '://ccr.' . $host . "." . $cdn_domain . $p;
+					$http_url =  $scheme . '://ccr.' . $host . "." . $cdn_domain;
+					push( @example_urls, $http_url );
 					if ($scheme2) {
-						$url = $scheme2 . '://ccr.' . $host . "." . $cdn_domain . $p;
-						push( @example_urls, $url );
+						$https_url = $scheme2 . '://ccr.' . $host . "." . $cdn_domain;
+						push( @example_urls, $https_url );
 					}
 				}
 				else {
-					$example_urls[ $re->{set_number} ] = $scheme . '://' . $re->{pattern} . $p;
+					 $http_url = $scheme . '://' . $re->{pattern};
+					 push( @example_urls, $http_url );
 					if ($scheme2) {
-						$url = $scheme2 . '://' . $re->{pattern} . $p;
-						push( @example_urls, $url );
+						$https_url = $scheme2 . '://' . $re->{pattern};
+						push( @example_urls, $https_url );
 					}
 				}
 			}