Commit Graph

246 Commits

Author SHA1 Message Date
Mayank Patel
a659b61323 Fix #271: Return 405 instead of 404 when request method doesn't match the route 2017-08-29 22:39:17 -07:00
Chris Hines
ac112f7d75 Prefer scheme on child route when building URLs. 2017-07-04 00:43:45 -07:00
Chris Hines
37b3a6cace Use scheme from parent router when building URLs. 2017-07-04 00:43:45 -07:00
Cody Oss
8c683ee571 Fix typo 2017-06-21 15:07:33 -07:00
Chris Hines
18fca31550 Add test and fix for escaped query values.
Reproduces and fixes #238.
2017-06-02 12:31:40 -07:00
Chris Hines
c7a138dbc1 Update docs. 2017-06-02 12:31:40 -07:00
Pavel Ivanov
f9aa23a02b Add tests for support for queries in URL reversing. 2017-06-02 12:31:40 -07:00
Pavel Ivanov
9c9af153a1 Add support for queries in URL reversing. 2017-06-02 12:31:40 -07:00
Nick Hudkins
043ee6597c Update Walking Routes Section
Fixed invalid method chaining.
2017-05-23 18:01:04 -07:00
Nick Hudkins
59ce66852b Fix invalid example code
In the "List Routes" example code, `.HandleFunc` was being called on a `*mux.Route` rather than `*mux.Router`. Updated the example code to work :)
2017-05-23 18:01:04 -07:00
Brian Michel
85b8c203a4 Removing half of conflict marker (#268)
Looks like there was just part of a conflict marker in the README file, so I figured I'd remove it.
2017-05-22 19:46:13 -07:00
Nick Miyake
456bcfa82d Update README with example for Router.Walk 2017-05-22 08:17:48 -07:00
Nick Miyake
4d814f7650 Update ancestors parameter for WalkFunc for matcher subrouters
Fixes #263
2017-05-22 08:17:48 -07:00
Nick Miyake
a322b2c2ec Update Walk to match all subrouters
Matches all routes instead of just routes with paths.

Fixes #261
2017-05-21 14:35:07 -07:00
Chris Hines
bcd8bc72b0 Support building URLs with non-http schemes. (#260)
* Move misplaced tests and fix comments.

* Support building URLs with non-http schemes.

- Capture first scheme configured for a route for use when building
  URLs.
- Add new Route.URLScheme method similar to URLHost and URLPath.
- Update Route.URLHost and Route.URL to use the captured scheme if
  present.

* Remove Route.URLScheme method.

* Remove UTF-8 BOM.
v1.4.0
2017-05-20 21:50:13 -07:00
Bulat Gaifullin
751308a60a Updated README 2017-05-20 15:55:46 -07:00
Bulat Gaifullin
b552615e22 Added method Route.GetMethods 2017-05-20 15:55:46 -07:00
Bulat Gaifullin
1856953e53 Added method Route.GetPathRegexp 2017-05-20 15:55:46 -07:00
Carlos Alexandro Becker
4c1c3952b7 fixed typo (#250) 2017-04-26 21:12:50 -07:00
Diego Siqueira
599cba5e7b Fixing Regexp in the benchmark test (#234)
Signed-off-by: DiSiqueira <dieg0@live.com>
2017-02-28 14:43:54 -08:00
Shane Smith-Sahnow
ad4ce0eb16 updating logic in route matcher, cleaner and saner (#235) 2017-02-27 19:44:49 -08:00
Kamil Kisiel
999ef73f5d Merge pull request #232 from DavidJFelix/patch-1
Add sourcegraph badge
2017-02-23 12:25:54 -08:00
David J. Felix
89d16fe9a0 Add sourcegraph badge
Fixes #228
2017-02-23 14:57:28 -05:00
Kamil Kisiel
94e7d24fd2 Add Go 1.8 to .travis.yml 2017-02-17 11:26:16 -08:00
Adam Eijdenberg
392c28fe23 [bugfix] fail fast if regex is incorrectly specified using capturing groups. (#218) v1.3.0 2017-01-18 05:43:44 -08:00
Shawn Smith
cafdb65e9e [docs] Add route listing example to README
* Update README.md

* Update README.md
2017-01-18 05:43:23 -08:00
Kamil Kisiel
b12896167c Merge pull request #199 from wirehead/minor-doc-tweek
Clarify how route variables work. (#151)
v1.2.0
2017-01-16 23:01:07 -08:00
Kamil Kisiel
34dda716af Merge pull request #215 from ShaneSaww/fix_for_subroutes_with_pathPrefix
Adding in a check for routes with just /
2017-01-16 22:41:11 -08:00
ShaneSaww
b9ff34f617 Adding some extra tests, to hit all the use cases 2017-01-16 21:11:35 -08:00
ShaneSaww
293ebe1493 Adding in a check for routes with just / 2017-01-15 21:47:00 -08:00
Ken Wronkiewicz
910dd3aa31 Remove unnecessary line from example
Review comment: setting the header complicates things.
2016-10-03 15:30:11 -07:00
Ken Wronkiewicz
239e05fe53 Clarify how route variables work. (#151)
(this confused the heck out of me while trying to use Gorilla)

* Changed `request` to be just `r`, like the other handlers.
* Created complete wrapper function instead of just 2 lines.
2016-09-30 10:54:10 -07:00
Kamil Kisiel
757bef944d Merge pull request #196 from olt/doc-non-capture-groups
document non-capturing groups (closes #143)
2016-09-20 16:08:13 -07:00
Oliver Tonnhofer
14f5df0128 document non-capturing groups (closes #143) 2016-09-20 16:06:56 +02:00
Kush Mansingh
0a192a1931 Add useEncodedPath option to router and routes (#190)
- Resolves a breaking change in #184
2016-09-02 08:33:43 -07:00
Richard Musiol
0b13a92220 Simplify extractVars, fixes edge cases. (#185)
Also make sure all regexp groups in tests are non-capturing.
2016-08-27 09:50:34 -07:00
Aaron Taylor
34bf6dc9fa make the getPath method safer, fixing panics within App Engine (#189) 2016-08-24 16:34:02 -07:00
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
2016-08-24 06:45:17 -07:00
Kamil Kisiel
cf79e51a62 .travis.yml: add go1.7 2016-08-16 11:46:30 -07:00
Matt Silverlock
7804150971 [docs] Add logo to README. (#180) 2016-08-01 10:00:46 -07:00
Matt Silverlock
3b15f12d15 [docs] Add static file example to README; doc.go. (#179) 2016-08-01 08:51:14 -07:00
Kamil Kisiel
327d4b684c Clean up some naming in mux_test.go 2016-07-30 16:45:59 -07:00
Matt Silverlock
a49d62f618 [bugfix] Fix error handling in Router.Walk (#177) 2016-07-26 18:54:17 -07:00
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.
2016-07-25 18:05:24 +02:00
Matt Silverlock
d391bea311 [docs] README typo (#175) 2016-07-18 08:11:58 -07:00
delong
198f95d824 fix README.md 2016-07-18 13:28:55 +08:00
Matt Silverlock
9fa818a44c [ci] Update .travis-ci to skip install block. (#170)
Ref 12a13f34e4 (commitcomment-17371551)
2016-06-05 16:35:21 -07:00
Kamil Kisiel
e84fac997f Merge pull request #169 from ejholmes/go1.7-context
Store vars and route in context.Context when go1.7+ is used
2016-06-04 09:35:56 -07:00
Eric J. Holmes
fdfca9f917 Support native context.Context when go1.7 is used. 2016-06-04 15:38:01 +07:00
Eric J. Holmes
5dd56998c2 Add failing context.Context test for go1.7. 2016-06-04 15:21:55 +07:00