You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/10/22 16:11:27 UTC
[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #6308: adding conditional to check if cdnName == ALL
rawlinp commented on a change in pull request #6308:
URL: https://github.com/apache/trafficcontrol/pull/6308#discussion_r734674920
##########
File path: traffic_ops/v4-client/deliveryservice_requests.go
##########
@@ -76,6 +77,9 @@ func (to *Session) CreateDeliveryServiceRequest(dsr tc.DeliveryServiceRequestV4,
}
if ds.CDNID == nil && ds.CDNName != nil {
+ if strings.ToUpper(*ds.CDNName) == "ALL" {
+ return resp, toclientlib.ReqInf{}, fmt.Errorf("CDN Name: \"'%s'\" is not allowed", *ds.CDNName)
+ }
Review comment:
Normally, we would add this kind of validation into the TO server rather than just the clients. Here, for example: https://github.com/apache/trafficcontrol/blob/master/traffic_ops/traffic_ops_golang/deliveryservice/deliveryservices.go#L1332
We would have to get the CDN name from the DB using the given CDN ID in the request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org