ocket8888 commented on a change in pull request #3900: Rewrite 
/cachegroups/{{id}}/parameters to Go
URL: https://github.com/apache/trafficcontrol/pull/3900#discussion_r320760370
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/routing/routes.go
 ##########
 @@ -119,6 +119,8 @@ func Routes(d ServerData) ([]Route, []RawRoute, 
http.Handler, error) {
                {1.1, http.MethodPost, `cachegroups/{id}/queue_update$`, 
cachegroup.QueueUpdates, auth.PrivLevelOperations, Authenticated, nil},
                {1.1, http.MethodPost, `cachegroups/{id}/deliveryservices/?$`, 
cachegroup.DSPostHandler, auth.PrivLevelOperations, Authenticated, nil},
 
+               {1.1, http.MethodGet, `cachegroups/{id}/parameters/?$`, 
api.ReadHandler(&cachegroup.TOCacheGroupParameter{}), auth.PrivLevelReadOnly, 
Authenticated, nil},
 
 Review comment:
   I think this needs to support an optional `.json` suffix. In Perl this was 
silently accepted by the server, and clients may have depended on that behavior 
(they shouldn't have IMO, but it was fairly common). In fact, it looks like 
Perl would accept
   
   - `/cachegroups/{{ID}}/parameters.json`
   - `/cachegroups/{{ID}}/parameters`
   - `/cachegroups/{{ID}}/parameters/`
   - `/cachegroups/{{ID}}/parameters/.json`
   - and even `/cachegroups/{{ID}}/parameters.sntoaheusntha`
   
   Pretty sure we don't support that last one, but a lot of handlers (see the 
`cdns/name/{name}/sslkeys` route directly below for an example) support all the 
others.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to