fixed path issue with url parameters
This commit is contained in:
parent
9a1490784e
commit
9bf43315b3
2 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ func (router *Router) validateRoute(path string) error {
|
|||
|
||||
func (router *Router) ServeHTTP(response http.ResponseWriter, request *http.Request) {
|
||||
// check for exact matching
|
||||
route, _, parameter := router.findRoute(request.Method, request.RequestURI, false)
|
||||
route, _, parameter := router.findRoute(request.Method, request.URL.Path, false)
|
||||
if route != nil && route.handler != nil {
|
||||
route.handler.ServeHTTP(response, request, RoutingInfo{Parameters: parameter})
|
||||
return
|
||||
|
|
|
@ -90,7 +90,7 @@ func TestRouterServerHandler(t *testing.T) {
|
|||
go http.Serve(listener, router)
|
||||
|
||||
// call method
|
||||
_, err = http.Get("http://localhost:8081/")
|
||||
_, err = http.Get("http://localhost:8081/?test=false")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue