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
Currently, with the following route, there is no way to differentiate between accessing /kv/foo/bar and /kv/foo%2Fbar:
app.get("/kv/:key{.+}",async(c)=>{console.log(c.req.param("key"))// => Always returns "foo/bar" in both cases})
It seems that since #659, c.req.param() now returns a decoded string by default.
But I want to distinguish whether the input parameter contained a literal / or if it was an encoded %2F.
I know that c.req.path can be used to get the raw path, but manually parsing it is cumbersome.
And if the route hierarchy (/kv) changes, the position of :key would shift, and there's no type checking to detect such changes, which is concerning.
A method like c.req.rawParam() would be useful I think.
The text was updated successfully, but these errors were encountered:
What is the feature you are proposing?
Currently, with the following route, there is no way to differentiate between accessing
/kv/foo/bar
and/kv/foo%2Fbar
:It seems that since #659,
c.req.param()
now returns a decoded string by default.But I want to distinguish whether the input parameter contained a literal
/
or if it was an encoded%2F
.I know that
c.req.path
can be used to get the raw path, but manually parsing it is cumbersome.And if the route hierarchy (
/kv
) changes, the position of:key
would shift, and there's no type checking to detect such changes, which is concerning.A method like
c.req.rawParam()
would be useful I think.The text was updated successfully, but these errors were encountered: