net/http: StripPrefix creates a new request, confusing middleware #20948
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
As of http://golang.org/cl/36483, StripPrefix creates a new request with the modified URL rather than modifying the existing request. That means that the identify of the request object can change between different handlers. If an earlier handler used a map[*http.Request], and then a later handler tries to read that value, it won't find it. This broke one important Google-internal use case, and a Github search shows a lot of such maps, so it may be worth addressing. I don't know how given the conflicting requirement to not modify the request.
The text was updated successfully, but these errors were encountered: