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 2018/09/21 21:55:30 UTC

[trafficcontrol] branch master updated: Prohibit content invalidation requests for no-origin DS types

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c06696a  Prohibit content invalidation requests for no-origin DS types
c06696a is described below

commit c06696a6d9ad5f72805aea6211ce3108a25a342d
Author: Rawlin Peters <ra...@comcast.com>
AuthorDate: Fri Sep 21 15:23:13 2018 -0600

    Prohibit content invalidation requests for no-origin DS types
    
    Prevent the submission of content invalidation requests against DS types
    that don't have origins (e.g. CLIENT_STEERING).
---
 traffic_ops/app/lib/API/Job.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/traffic_ops/app/lib/API/Job.pm b/traffic_ops/app/lib/API/Job.pm
index 7281444..fbd7c4a 100644
--- a/traffic_ops/app/lib/API/Job.pm
+++ b/traffic_ops/app/lib/API/Job.pm
@@ -168,6 +168,10 @@ sub create_current_user_job {
 	if ( !defined($ds) ) {
 		return $self->not_found();
 	}
+	my $org_server_fqdn = UI::DeliveryService::compute_org_server_fqdn($self, $ds_id);
+	if ( !defined($org_server_fqdn) ) {
+		return $self->alert("cannot invalidate content: requested delivery service has no origin");
+	}
 
 	my $tenant_utils = Utils::Tenant->new($self);
 	my $tenants_data = $tenant_utils->create_tenants_data_from_db();