-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Switch to forked httprouter
and enable UseRawPath
option
#11068
Conversation
UseRawPath
optionhttprouter
and enable UseRawPath
option
I see that this will indeed fix the problem, but I can't help but ask if we should really be using httprouter at all? It's clearly no longer maintained, and each new fork we pull in creates additional burden on us. I'm fine with merging this, but I wonder if we should also evaluate using a different router that is actively maintained. |
Indeed the Having said that, I'm worried about the potential costs of the switch. There may be hard-to-find compatibility issues lurking, while the benefits are seemingly few or none? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, although I didn't go all the way digging on httprouter or UseRawPath.
That's true, it's a scary change to make. I think the lesson is to be very careful about the dependencies we pull in, specially far reaching ones like httprouter. My 2c is that best way to "fix" this is to kill all REST APIs in favor of gRPC. One can dream. :) |
There are at least two of us dreaming the same dream 😄 |
There are at least |
* Use forked httprouter with RawPath fix: gravitational/httprouter * Enable UseRawPath everywhere. * Test: allow MFA devices with `/` in names to be deleted Co-authored-by: Przemko Robakowski <[email protected]>
* Use forked httprouter with RawPath fix: gravitational/httprouter * Enable UseRawPath everywhere. * Test: allow MFA devices with `/` in names to be deleted Co-authored-by: Przemko Robakowski <[email protected]>
…#12080) * Use forked httprouter with RawPath fix: gravitational/httprouter * Enable UseRawPath everywhere. * Test: allow MFA devices with `/` in names to be deleted Co-authored-by: Przemko Robakowski <[email protected]>
…#12081) * Use forked httprouter with RawPath fix: gravitational/httprouter * Enable UseRawPath everywhere. * Test: allow MFA devices with `/` in names to be deleted Co-authored-by: Przemko Robakowski <[email protected]>
* Use forked httprouter with RawPath fix: gravitational/httprouter * Enable UseRawPath everywhere. * Test: allow MFA devices with `/` in names to be deleted Co-authored-by: Przemko Robakowski <[email protected]>
…#12109) * Use forked httprouter with RawPath fix: gravitational/httprouter * Enable UseRawPath everywhere. * Test: allow MFA devices with `/` in names to be deleted Co-authored-by: Przemko Robakowski <[email protected]>
The httprouter package mishandles the URL-encoded
/
present in request paths. Despite requests and available PRs, this hasn't been fixed:We are affected by this issue in many ways, e.g.:
/
in names to be deleted from UI #11011This PR fixes the problem by switching to our fork of
httprouter
: https://github.com/gravitational/httprouter, which has one of the proposed patches applied. The fork's main branch isteleport
, which is based on tag1.3.0v
we were using.The fork adds
UseRawPath
option to the router, which is false by default to maintain backward compatibility.Here we enable that option for all our usages of the router. To verify the fix to our routing, a single test is added (taken from #11011).
Fixes
TEL-Q122-7
.