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/12/21 19:44:11 UTC

[GitHub] moltzaum commented on issue #3117: Bad regex for PUT method of /api/1.x/users endpoint

moltzaum commented on issue #3117: Bad regex for PUT method of /api/1.x/users endpoint
URL: https://github.com/apache/trafficcontrol/issues/3117#issuecomment-449481333
 
 
   `PUT /api/1.x/users` was never designated to be an endpoint. There is still an issue with the regex. It seems I wanted to write a single regex for the `MethodGet`, so I made the {id} optional. It is better to have two regexs, one where the id is not required and another where it is. The optional {id} should not apply to the PUT, or the delete if it were to be implemented.
   ```go
   {1.4, http.MethodGet, `users/?(\.json)?$`},
   {1.4, http.MethodGet, `users/{id}?(\.json)?$`},
   {1.4, http.MethodPut, `users/{id}?(\.json)?$`},
   {1.4, http.MethodPost, `users/?(\.json)?$`},
   ```
   
   ```go
   {1.4, http.MethodGet, `users/?(\.json)?$`},
   {1.4, http.MethodGet, `users/{id}$`},
   {1.4, http.MethodPut, `users/{id}$`},
   {1.4, http.MethodPost, `users/?(\.json)?$`,
   ```
   I'll fix and update the documentation.

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