You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #561, I commented that we had added middleware (early in the chain, but after routing) which used QueryUnescape on all the path params.
That turned out to be wrong to, because the rules for query escaping are not the same as for path escaping. golang 1.8 has acknowledged this by adding new PathEscape and PathUnescape functions.
I think the cleanest solution is:
do not unescape the URI. Let the router see the raw, escaped incoming URI, and match against that
When constructing the Context and populating it with the path params, unescape the path params. So in my handlers/middleware, when I call c.Param(), I get back a value which has already been unescaped
do not unescape the URI. Let the router see the raw, escaped incoming URI, and match against that
Agree
When constructing the Context and populating it with the path params, unescape the path params. So in my handlers/middleware, when I call c.Param(), I get back a value which has already been unescaped
can this be done outside the framework? Not in favour of extra calculation inside.
path param unescaping could be done with middleware as well (so long as
echo 3 still supports Context.SetParams(), haven't checked). Perhaps
provide middleware out of the box.
Or, just make this a config flag on the Echo instance.
Echo.UnscapePathParams bool
On Thu, Dec 8, 2016 at 2:23 PM Vishal Rana ***@***.***> wrote:
do not unescape the URI. Let the router see the raw, escaped incoming URI,
and match against that
Agree
When constructing the Context and populating it with the path params,
unescape the path params. So in my handlers/middleware, when I call
c.Param(), I get back a value which has already been unescaped
can this be done outside the framework? Not in favour of extra calculation
inside.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#766 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGlMWAb9C_S0mgjCbejiZltJU84yZkQks5rGFkTgaJpZM4LHauJ>
.
Activity
vishr commentedon Dec 8, 2016
We have gone back and forth in these issues and I am not sure how it should be addressed. Appreciate everyone's opinion.
@cdfox @yaa110 @Anon-Penguin @ansel1 @luca-moser @CaptainCodeman
ansel1 commentedon Dec 8, 2016
In #561, I commented that we had added middleware (early in the chain, but after routing) which used QueryUnescape on all the path params.
That turned out to be wrong to, because the rules for query escaping are not the same as for path escaping. golang 1.8 has acknowledged this by adding new PathEscape and PathUnescape functions.
I think the cleanest solution is:
c.Param(), I get back a value which has already been unescapedvishr commentedon Dec 8, 2016
Agree
can this be done outside the framework? Not in favour of extra calculation inside.
ansel1 commentedon Dec 8, 2016
vishr commentedon Dec 8, 2016
For now, it's even with v2.
fixed #766
mathvav commentedon Dec 9, 2016
So are path params currently escaped? Query string values?
(I agree that the router should use the raw path.)
vishr commentedon Dec 9, 2016
Everything is raw.
arun0009 commentedon Apr 2, 2020
how to pass raw URL as is without decoding in proxy pass? I see that its decoding URL before sending it upstream