goweb
goweb copied to clipboard
trailling slash with url /hello/ should return not found as /hello/xx/
http://localhost:8080/hello/xx/ return {"message":"Page Not Found"}
but http://localhost:8080/hello/ return {"hello":""}
It looks like your two examples are the same? Is there a typo? Or, can you explain the problem a bit more?
It looks like your two examples are the same? Is there a type? Or, can you explain the problem a bit more?
issue updated
http://localhost:8080/hello/xxx/ return {"message":"Page Not Found"}
but http://localhost:8080/hello/ return {"hello":""}
expect http://localhost:8080/hello/xxx match app.GET("/hello/{name}" http://localhost:8080/hello/ or http://localhost:8080/hello/xxx/ return 404
It looks like trailing slashes aren't handled the way you are expecting them.
app.GET("/hello/{name}", handler) will match /hello/ with name === "".
app.GET("/hello/{name}", handler) will not match /hello/Bob/ and 404 will be returned.
I welcome a PR that allows the trailing slash config to be customized.