ocket8888 commented on a change in pull request #3023: WIP Supported routes 
fetch
URL: https://github.com/apache/trafficcontrol/pull/3023#discussion_r233239357
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/routes.go
 ##########
 @@ -424,6 +424,17 @@ func Routes(d ServerData) ([]Route, []RawRoute, 
http.Handler, error) {
                {http.MethodGet, `tools/write_crconfig/{cdn}/?$`, 
crconfig.SnapshotOldGUIHandler, auth.PrivLevelOperations, Authenticated, nil},
                // DEPRECATED - use GET /api/1.2/cdns/{cdn}/snapshot
                {http.MethodGet, `CRConfig-Snapshots/{cdn}/CRConfig.json?$`, 
crconfig.SnapshotOldGetHandler, auth.PrivLevelReadOnly, Authenticated, nil},
+
+               // The '/api' endpoint, that tells clients what routes are 
available under /api/1.x
+               {http.MethodGet, `api/?$`, api.AvailableRoutesHandler, 0, 
false, nil},
 
 Review comment:
   Our CORS headers are being sent on every response, without regard for 
whether they're actually CORS preflight requests. They also report some methods 
as "accessible" even though actually using them will confusingly cause a 
'server side error' and report to the user that the API version they're looking 
for isn't implemented. It'd be better to just get that fixed (probably by 
[re-working the method/route 
mapping](https://github.com/apache/trafficcontrol/pull/3023#discussion_r233230570)
 )

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to