mitchell852 commented on a change in pull request #5128:
URL: https://github.com/apache/trafficcontrol/pull/5128#discussion_r504857614
##########
File path: traffic_ops/traffic_ops_golang/server/servers.go
##########
@@ -782,12 +782,17 @@ func getServers(h http.Header, params map[string]string,
tx *sqlx.Tx, user *auth
usesMids := false
queryAddition := ""
dsHasRequiredCapabilities := false
+ var dsCDNName tc.CDNName
if dsIDStr, ok := params[`dsId`]; ok {
// don't allow query on ds outside user's tenant
dsID, err := strconv.Atoi(dsIDStr)
if err != nil {
return nil, 0, errors.New("dsId must be an integer"),
nil, http.StatusNotFound, nil
}
+ _, dsCDNName, _, err = dbhelpers.GetDSNameAndCDNFromID(tx.Tx,
dsID)
+ if err != nil {
+ return nil, 0, errors.New("ds not found"), nil,
http.StatusNotFound, nil
+ }
Review comment:
well, it doesn't always check the cdn. for example:
GET /servers <-- doesn't check cdn
GET /servers?type=ORG <-- doesn't check cdn
GET /servers?dsId=X <-- does check cdn
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]