Benjamin Boudreau
15a353a636
adding Router.Name to create new Route ( #457 )
7 years ago
Michael Li
6137e193cd
remove redundant code that remove support gorilla/context ( #427 )
...
* remove redundant code that remove support gorilla/context
* backward compatible for remove redundant code
7 years ago
Joe Wilner
758eb64354
Improve subroute configuration propagation #422
...
* Pull out common shared `routeConf` so that config is pushed on to child
routers and routes.
* Removes obsolete usages of `parentRoute`
* Add tests defining compositional behavior
* Exercise `copyRouteConf` for posterity
7 years ago
Matt Silverlock
e3702bed27
[docs] Improve docstrings for middleware, skipclean ( #375 )
8 years ago
Matt Silverlock
ded0c29b24
Fix linter issues (docs) ( #370 )
8 years ago
Roberto Santalla
53c1911da2
[feat] Add middleware support as discussed in #293 ( #294 )
...
* mux.Router now has a `Use` method that allows you to add middleware to request processing.
8 years ago
Matt Silverlock
c572efe429
[docs] Note StrictSlash re-direct behaviour #308 ( #321 )
...
* [docs] Note StrictSlash re-direct behaviour #308
* StrictSlash enabled routes return a 301 to the client
* As per the HTTP standards, non-idempotent methods, such as POST or PUT, will be followed with a GET by the client
* Users should use middleware if they wish to change this behaviour to return a HTTP 308.
* Update description of StrictSlash
8 years ago
Chris Dostert
2d5fef06b8
[docs] fix outdated UseEncodedPath method docs ( #314 )
...
https://github.com/gorilla/mux/pull/306 changed UseEncodedPath to use native go encoded path handling so cautions in it's docs are no longer applicable.
8 years ago
Roberto Santalla
7f08801859
MatchErr is set to ErrNotFound if NotFoundHandler is used ( #311 )
8 years ago
Kamil Kisiel
9f48112f18
[docs] Document router.Match ( #313 )
...
* Document router.Match
The return values are getting confusing. Hopefully this helps.
* Simplify some language.
* Remove double the
8 years ago
Mike Busch
c9183aaddd
use req.URL.EscapedPath() instead of getPath(req) ( #306 )
...
This change drops support of go < 1.5. go1.5 has been officially
unsupported since go1.7 was released 2016/08/15.
8 years ago
Mayank Patel
a659b61323
Fix #271 : Return 405 instead of 404 when request method doesn't match the route
8 years ago
Chris Hines
37b3a6cace
Use scheme from parent router when building URLs.
9 years ago
Cody Oss
8c683ee571
Fix typo
9 years ago
Nick Miyake
4d814f7650
Update ancestors parameter for WalkFunc for matcher subrouters
...
Fixes #263
9 years ago
Nick Miyake
a322b2c2ec
Update Walk to match all subrouters
...
Matches all routes instead of just routes with paths.
Fixes #261
9 years ago
Kush Mansingh
0a192a1931
Add useEncodedPath option to router and routes ( #190 )
...
- Resolves a breaking change in #184
9 years ago
Aaron Taylor
34bf6dc9fa
make the getPath method safer, fixing panics within App Engine ( #189 )
9 years ago
Kush Mansingh
674ef1c280
Add mechanism to route based on the escaped path ( #184 )
...
* Add mechanism to route based on the escaped path, correct request mocking in tests
* Remove unneccessary regex matching, substitute with string slicing
* Add test case and handling for requests with no host/scheme
9 years ago
Martin Hamrle
cf57124f1d
Fix error handling in Router.Walk
...
In old version error was not returned properly, In one walkFn call
error was checked only for SkipRouter but not for nil.
10 years ago
Eric J. Holmes
fdfca9f917
Support native context.Context when go1.7 is used.
10 years ago
Jingwen Owen Ou
a41434aac3
Clarify more of `SkipClean`
10 years ago
Jingwen Owen Ou
786d36e5ab
`go fmt`
10 years ago
Dave Newman
8ac5cf967f
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
10 years ago
Matt Silverlock
02c98b3f73
[docs] Satisfied golint.
...
- SkipRouter should also be ErrRouterSkipped (or similar) but a change would
break the public API.
10 years ago
bign8
c329c7d193
Potential fix for #20
10 years ago
Matt Casper
ac3897eae3
Fix a typo in the comments, add a few comment docs
10 years ago
Orne Brocaar
13c8226081
Update comment and specify KeepContext option.
11 years ago
Orne Brocaar
39cff3481c
Add note about the availability of CurrentRoute.
11 years ago
Clint Ryan
98fb535d77
Issue 16: Return the regexp compile error
11 years ago
Dj Gilcrease
92ae1d6726
Update the walk method to walk matchers so it walks the full list of routers and child routers
11 years ago
Clint Ryan
c21431a6cd
Fixed up commenting and removed unused code
11 years ago
Craig Jellick
c0a5cbce5a
Fix typo
...
Issue #16 : Added regex support for matching headers
Issue #16 : Addressed code review and refactored support for regex into
a separate function
Added compiled regex to route matcher
11 years ago
Craig Jellick
a063f14812
Fix typo
...
Issue #16 : Added regex support for matching headers
Issue #16 : Addressed code review and refactored support for regex into
a separate function
Added compiled regex to route matcher
11 years ago
Kamil Kisiel
854d482e26
Fix racy modification of NotFoundHandler.
12 years ago
Quinn Slack
a883d5a9b9
Call parent BuildVarsFuncs
12 years ago
Quinn Slack
cef3b0cd6d
Add BuildVarsFunc to allow modifying route variables before generating a route's URL
12 years ago
Thomas ten Cate
b864f07c53
Propagate StrictSlash to subrouters instead of rudely turning it off
12 years ago
Thomas ten Cate
033224c12e
Document behaviour of StrictSlash and PathPrefix better, and add tests to nail this down
12 years ago
Quinn Slack
9ee70e572c
gofmt
12 years ago
Philip Schlump
d10d5466f2
Fixed problem with droping query string.
12 years ago
Julien Schmidt
0ae6d35b08
Fix typo
...
remove doubly present "the"
12 years ago
John Nadratowski
e718e932ee
Add KeepContext flag to Router to disable clearing of context data.
13 years ago
Sergey Shepelev
38545dbae8
Removed excess bool variable assignment in `if`s
13 years ago
Jongmin Kim
78f6049258
Update mux.go
...
unnecessary comma
13 years ago
moraes
eac83ba2c0
Initial files.
13 years ago