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: trailing slash requests are redirected with raw URL being tracked #2293

Closed
laughingman-hass opened this issue Oct 25, 2023 · 3 comments
Assignees
Labels
bug unintended behavior that has to be fixed

Comments

@laughingman-hass
Copy link
Contributor

Version of dd-trace-go
v1.56.1

Describe what happened:

The dimfeld/httptreemux router has logic to handle trailing slashes which redirects to the URL without the trailing slash. This happens without the URL parameterized and sanitized of any sensitive information. This results in a second request being done, which is parameterized, but more importantly, it means that the first request is traced with its raw URL rather than the parametrized one. This happens because while looking up the resource with a trailing slash, the parameters are not detected.

Screenshot demonstrating this issue

Screenshot 2023-10-25 at 22 17 50

Describe what you expected:
Both requests should be parametrized as shown in the screenshot below

Screenshot 2023-10-25 at 22 18 38

Steps to reproduce the issue:

Call an endpoint with a trailing slash, while using the dimfeld/httptreemux.v5 router

Additional environment details (Version of Go, Operating System, etc.):
this issue is not related to an environment.

@laughingman-hass laughingman-hass added the bug unintended behavior that has to be fixed label Oct 25, 2023
@laughingman-hass laughingman-hass changed the title [BUG] dimfeld/httptreemux.v5: trailing slash requests are redirected with raw URL being tracked [BUG] contrib/dimfeld/httptreemux.v5: trailing slash requests are redirected with raw URL being tracked Oct 25, 2023
@katiehockman katiehockman self-assigned this Nov 27, 2023
@katiehockman
Copy link
Contributor

Hi @laughingman-hass! Thanks for filing this. I'm looking into this now, and will read over your PR very soon. Appreciate the details and the fix, and I'm sorry for the delay.

@katiehockman
Copy link
Contributor

Fixed in #2332

@katiehockman
Copy link
Contributor

Thank you for your patience with the release of this fix. v1.59.0 is now released, which includes this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unintended behavior that has to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants