Add SkipClean option

By default paths are run through the cleanPath method which prevents
using fancier paths like /fetch/http://xkcd.com/534

This adds a SkipClean option so that this path isn't redirected to
/fetch/http/xkcd.com/534
This commit is contained in:
Dave Newman
2014-05-20 14:59:54 -07:00
committed by Jingwen Owen Ou
parent 147a95f5e3
commit 8ac5cf967f
2 changed files with 30 additions and 9 deletions

View File

@@ -23,9 +23,12 @@ type Route struct {
matchers []matcher
// Manager for the variables from host and path.
regexp *routeRegexpGroup
// If true, when the path pattern is "/path/", accessing "/path" will
// redirect to the former and vice versa.
strictSlash bool
// If true, when the path pattern is "/path/", accessing "/path" will
// redirect to the former and vice versa.
strictSlash bool
// If true, when the path pattern is "/path//to", accessing "/path//to"
// will not redirect
skipClean bool
// If true, this route never matches: it is only used to build URLs.
buildOnly bool
// The name used to build URLs.