Nguyen Ngoc Trung (Steven)
521ea7b17d
Use constant for 301 status code in regexp.go ( #412 )
2018-10-23 19:08:00 -07:00
Kamil Kisiel
512169e5d7
refactor routeRegexp, particularily newRouteRegexp. ( #328 )
...
The existing options matchPrefix, matchHost, and matchQueries are
mutually exclusive so there's no point in having a separate boolean
argument for each one. It's clearer if there's a single type variable.
strictSlash and useEncodedPath were also being passed as naked bools so
I've wrapped these in a struct called routeRegexpOptions for more clarity
at the call site.
2018-01-05 10:40:59 -08:00
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.
2017-10-19 20:46:20 -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
Pavel Ivanov
9c9af153a1
Add support for queries in URL reversing.
2017-06-02 12:31:40 -07:00
Adam Eijdenberg
392c28fe23
[bugfix] fail fast if regex is incorrectly specified using capturing groups. ( #218 )
2017-01-18 05:43:44 -08: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
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
JP Robinson
65c2651643
fixing regexp changes from PR #144
2016-03-07 16:38:03 -05:00
Matt Silverlock
02c98b3f73
[docs] Satisfied golint.
...
- SkipRouter should also be ErrRouterSkipped (or similar) but a change would
break the public API.
2016-02-28 19:32:22 -08:00
Tomasz Kłak
f48927253f
Named groups replaced with conditional wrapping of regexps
2016-01-23 17:42:00 +01:00
Shinya Kawaguchi
d17b93cab8
Refactoring for better performance
2015-08-11 14:26:09 +09:00
Shinya Kawaguchi
273db68971
Fix regexp syntax error caused by variable names containing any characters except letters, digits, and underscores
2015-08-11 04:32:47 +09:00
Kamil Kisiel
e73f183699
fix use of capturing subexpressions in pattern matches.
...
The router now associates a regexp named group with each mux variable.
It only fills variables when capturing group name match instead of
relying on indices, which doesn't work if a variable regexp has interior
capturing groups.
Fixes #62
2015-08-06 20:32:43 -07:00
Kamil Kisiel
ba336c9cfb
getUrlQuery: Use SplitN with a max of 2.
2015-07-17 08:03:03 -07:00
Bay Dodd
fe40f0d056
updating query match string
2015-07-17 10:19:25 +01:00
Bay Dodd
19f0a91c4e
adding test and updating condition
2015-07-16 12:48:02 +01:00
Bay Dodd
2b32409792
fix for empty query
2015-07-16 10:52:01 +01:00
Bay Dodd
0c9d5c08c1
refactoring
2015-07-05 23:03:37 +01:00
Bay Dodd
a710a8bfa9
adding ^ and $ to query pattern
2015-07-05 12:49:02 +01:00
Kamil Kisiel
8a875a034c
Merge pull request #52 from sqs/BuildVarsFunc
...
BuildVarsFunc: modify route variables before building the URL from a route
2015-02-13 11:22:55 -08:00
Felipe Madrigal
d7e4639818
Rearrange rules for matching strict slash
2014-09-26 00:20:46 -05:00
Felipe Madrigal
8df3a80fb8
Rearrange getHost function
2014-09-26 00:20:12 -05:00
Raphael Simon
451fd8b779
Additional code cleanup (see comments on issue #56 )
2014-05-27 16:37:30 -07:00
Raphael Simon
69237eaae5
Fix "Queries" matcher to support out-of-order query string parameters
2014-05-27 09:34:08 -07:00
Raphael Simon
65cc9b5df8
Add ability to capture variables in query strings
2014-05-26 15:01:42 -07:00
Quinn Slack
cef3b0cd6d
Add BuildVarsFunc to allow modifying route variables before generating a route's URL
2014-04-23 11:44:16 -07:00
Thomas ten Cate
b864f07c53
Propagate StrictSlash to subrouters instead of rudely turning it off
2014-04-23 19:53:35 +02:00
moraes
eac83ba2c0
Initial files.
2012-10-03 01:48:17 -03:00