moltzaum edited a comment 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 the regex 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:
[email protected]


With regards,
Apache Git Services

Reply via email to