Closed
Description
The docs say
Except for reading the body, handlers should not modify the provided Request.
At the moment, it seems like modifying the provided http request is safe and this guarantee is restrictive but not useful.
In particular, following this guarantee prevents the subrouting approach presented in https://blog.merovius.de/2017/06/18/how-not-to-use-an-http-router.html as the *http.Request
's URL is modified when sending it to sub handlers so that they can route the remaining part of the URL on their own. The alternative would be to create a shallow copy of the request every time and then modifying the URL which can become expensive, as there would be a shallow copy for every single segment of the path.