/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/ / / / / / / / / / / / / / / / / /
Please use forum https://forum.labstack.com to ask questions!
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/ / / / / / / / / / / / / / / / / /
Issue Description
c.Params can't unescape when the parameter is a small case percent encoded string like %e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8f
but it can unescape a big case like %E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%82%8F
With default template engine in Go escapes multi byte in href to small case percent encoded string automatically, so we can't get unescaped string.
The cause is here.
In the case of a small case, r.RawPath becomes /%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8f so we get a escaped parameter. but in the case of a big case, r.RawPath becomes empty so we get a unescaped parameter from r.Path
Example playground
Checklist
Expected behaviour
We can get a unescaped path parameter.
Actual behaviour
We can get a escaped path parameter.
Steps to reproduce
Passing small case percent encoded string as path parameter.
Working code to debug
package main
import (
"net/http"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
e.GET("/:tag", func(c echo.Context) error {
return c.String(http.StatusOK, c.Param("tag"))
})
e.Logger.Fatal(e.Start(":1323"))
}
Access to localhost:1312/%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8f and localhost:1323/%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%82%8F
then we can get different responses %e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8f and こんにちわ
Version/commit
f867058
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/ / / / / / / / / / / / / / / / / /
Please use forum https://forum.labstack.com to ask questions!
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/ / / / / / / / / / / / / / / / / /
Issue Description
c.Paramscan't unescape when the parameter is a small case percent encoded string like%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8fbut it can unescape a big case like
%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%82%8FWith default template engine in Go escapes multi byte in
hrefto small case percent encoded string automatically, so we can't get unescaped string.The cause is here.
In the case of a small case,
r.RawPathbecomes/%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8fso we get a escaped parameter. but in the case of a big case,r.RawPathbecomes empty so we get a unescaped parameter fromr.PathExample playground
Checklist
Expected behaviour
We can get a unescaped path parameter.
Actual behaviour
We can get a escaped path parameter.
Steps to reproduce
Passing small case percent encoded string as path parameter.
Working code to debug
Access to
localhost:1312/%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8fandlocalhost:1323/%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%82%8Fthen we can get different responses
%e3%81%93%e3%82%93%e3%81%ab%e3%81%a1%e3%82%8fandこんにちわVersion/commit
f867058