julienschmidt/httprouter — pull request #15 by alexandernyquist (2014-07-01 10:01:52+00:00)
Title: Fix redirect loop when no root route is defined

Currently, if no root route ("/") is defined, the router will respond with a 301 redirect to "/". This ends up being an endless loop. Example:

router := httprouter.New()
router.GET("/hello/:name", Hello)
log.Fatal(http.ListenAndServe(":8082", router))

Hitting / will result in this endless loop.

I think the default should be to throw a 404.

I'm not 100% sure about the fix, but it works.