zrhoffman commented on a change in pull request #5128:
URL: https://github.com/apache/trafficcontrol/pull/5128#discussion_r504860567



##########
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:
       Right, but it always should check the CDN when the `dsId` query 
parameter exists, and all of the SQL for that part is in 
`deliveryServiceServersJoin` and `dssTopologiesJoinSubquery`.




----------------------------------------------------------------
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]


Reply via email to