Open DoLolitingyu opened 4 years ago
I believe I have fixed this in my fork: https://github.com/go-martini/martini/compare/master...klippa-app:martini:master
Basically Martini does path matching on the decoded version of the URL. In that matching it handles a few characters as path delimiters, like # and /. If your path contains encoded values of these (%23 and %2F), it will show up as decoded in the matching code of Martini and it will not match them on your route.
My changes will match the route on the encoded version of the URL (using req.URL.EscapedPath()
), and will then decode the path segments later on.
LIke: m.Get("/hello/**", func(params martini.Params) string { return "Hello " + params["_1"] })
Enter when I visit “/hello/test#test”, It's return 404. I want to know # is treated as something else? Thank you ^-^