admin
admin copied to clipboard
Route params that include a dot are not correctly interpreted
Say I have a route that looks like this:
API.GetRouter().Get("/getData/:value/", func(c *admin.Context) {
query := c.Request.URL.Query()
fmt.Println(utils.ToString(query.Get("value")))
})
If I make a GET request to localhost/getData/some.value/, the application will print some to stdout, rather than some.value.
This is because when interpreting the route, Qor will push parameters into the GET query string to make the parameters accessible within the request context. What seems to be happening is that any time there is a dot, that value is being interpreted as a format param.
Since dots are quite common, particularly when working with resources with parameters that are namespaced or relate to semver values, it would be great to understand a workaround or get a fix. Thanks!