httprouter icon indicating copy to clipboard operation
httprouter copied to clipboard

allow router to use request.URL.RawPath

Open halorium opened this issue 7 years ago • 11 comments

This addresses issue #208

When a path parameter contains url escaped characters (especially "/" as "%2F") it uses the raw path and doesn't automatically unescape the path.

This adds a field to the router struct called "UseRawPath" which allows for backward compatibility.

halorium avatar Jul 26 '17 20:07 halorium

It seems that go 1.6 and 1.7 don't have url.PathUnescape.

It would be nice to version httprouter so that updated go src functions can be used. This PR could be merged into the latest release of httprouter but not affect previous versions.

halorium avatar Jul 26 '17 21:07 halorium

Just noticed PR #55 Wow, that is an old one. Would love to get this functionality into httprouter :)

halorium avatar Jul 27 '17 22:07 halorium

The tests on this seem to be failing. I have been using a forked version of this library to do this for a while; any chance you could update to fix the tests so that I can cherry-pick this commit instead?

SamWhited avatar Mar 24 '18 17:03 SamWhited

@SamWhited I updated my fork to pull in changes since I made this PR but until Go 1.6 and 1.7 passing tests are no longer part the criteria, Travis will continue to fail. See my comment above. Glad this code change was useful to you.

halorium avatar Mar 26 '18 15:03 halorium

Made a minor change and updated tests to pass code coverage

halorium avatar Mar 26 '18 18:03 halorium

Ping. This is a very useful fix to a very long standing problem...

Any way to get this moving along?

tmornini avatar Apr 26 '18 22:04 tmornini

@julienschmidt is there any reason why it's not merged yet?

selslack avatar Jan 25 '19 16:01 selslack

@julienschmidt I updated this PR if it's helpful :)

halorium avatar Oct 02 '21 16:10 halorium

@julienschmidt any update on this? I think this change could fix bugs in many other projects(example) which depend on httprouter.

bachmanity1 avatar Nov 23 '21 07:11 bachmanity1

Also here looking for this. Any timelines on when this might be added? Thanks.

darrenparkinson avatar Apr 28 '22 12:04 darrenparkinson

Hi, is there any update on this at all? (or issue #284) I really could use this being implemented. I could switch permanently to the gravitational fork, but that is 48 commits behind, and I could implement the capability locally I guess, but I'd rather stick with the original. I'm temporarily switching between the two to temporarily fix issues as they come up. Any feedback greatly appreciated. Appreciate time is a challenge. Many thanks for any assistance you can provide.

darrenparkinson avatar Jun 27 '22 08:06 darrenparkinson