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 2018/05/08 18:19:34 UTC

[GitHub] rob05c commented on issue #2243: Routes.go file should include type capture groups to enforce route parameter types

rob05c commented on issue #2243: Routes.go file should include type capture groups to enforce route parameter types
URL: https://github.com/apache/incubator-trafficcontrol/issues/2243#issuecomment-387495247
 
 
   What's the goal of this? 
   
   The handler will still get a string, so it still has to cast it, and it should still check the cast succeeds for safety.
   
   The only thing I see this accomplishing, is to allow `asns/{id:[0-9]}` and `asns/{name:[a-z0-9]}` - but what if the name is "42"?
   
   For routes which have the same path for names and IDs, we've been making them try to cast as an int, and assume success means an ID, and failure means a name. We can't do much better for existing routes. And we shouldn't be making any new routes that overlap, because of this problem.

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


With regards,
Apache Git Services