[BUG] contrib/dimfeld/httptreemux.v5: default resource namer incorrectly replaces path variables #2812
Labels
apm:ecosystem
contrib/* related feature requests or bugs
bug
unintended behavior that has to be fixed
Version of dd-trace-go
v1.65.1
Describe what happened:
The default resource name in the
contrib/dimfeld/httptreemux.v5
package has a bug where the path variable replacement fails under certain conditions.E.g. if you have a route
/foo/2by4/bar/:n
and request path/foo/2by4/2
then the code will attempt to replace the first occurrence of/2
with/:n
which will result in the path:/foo/:nby4/2
.Describe what you expected:
The code should replace the correct variable and leave the rest of the path unaltered.
Steps to reproduce the issue:
GET /foo/2by4/bar/:n
GET /foo/2by4/2
Additional environment details (Version of Go, Operating System, etc.):
The text was updated successfully, but these errors were encountered: