Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] contrib/dimfeld/httptreemux.v5: default resource namer incorrectly replaces path variables #2812

Open
devillecodes opened this issue Aug 7, 2024 · 1 comment · May be fixed by #2881
Labels
apm:ecosystem contrib/* related feature requests or bugs bug unintended behavior that has to be fixed

Comments

@devillecodes
Copy link
Contributor

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:

  1. Include the router in a project.
  2. Register a handler for an endpoint, eg. GET /foo/2by4/bar/:n
  3. Call the endpoint with the following: GET /foo/2by4/2

Additional environment details (Version of Go, Operating System, etc.):

@devillecodes devillecodes added the bug unintended behavior that has to be fixed label Aug 7, 2024
@github-actions github-actions bot added needs-triage New issues that have not yet been triaged apm:ecosystem contrib/* related feature requests or bugs labels Aug 7, 2024
@darccio darccio removed the needs-triage New issues that have not yet been triaged label Aug 13, 2024
@darccio
Copy link
Member

darccio commented Aug 13, 2024

Thanks for reaching out. We'll review this and fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs bug unintended behavior that has to be fixed
Projects
None yet
2 participants