echo icon indicating copy to clipboard operation
echo copied to clipboard

Routing is stripping fragements

Open maciej-jezierski opened this issue 3 years ago • 1 comments

Issue Description

I try to get access to URL fragment (after #), but it's returning an empty value. I wonder if in the middle of the routing echo is not losing information.

Expected behaviour

A fragment is not empty in the request URL

Actual behaviour

A fragment is empty in the request URL

Steps to reproduce

Register GET endpoint

func RegisterEndpoints(e *echo.Echo) {
e.GET("/test", func(c echo.Context) error {
if c.Request().URL.Fragment == "" {
returnc.NoContent(http.StatusUnauthorized)
}
return c.NoContent(http.StatusAccepted)
})
}

Hit endpoint with hash like /test#data=1234

Version/commit

v4.3.0

maciej-jezierski avatar Jul 27 '21 14:07 maciej-jezierski

Fragments are never part of a request. They are only processed at the client and not visible for the server.

So this behavior is expected and not a bug

georgmu avatar Aug 06 '21 20:08 georgmu