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.
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
Chris Hines
18fca31550
Add test and fix for escaped query values.
...
Reproduces and fixes #238 .
9 years ago
Pavel Ivanov
9c9af153a1
Add support for queries in URL reversing.
9 years ago
Adam Eijdenberg
392c28fe23
[bugfix] fail fast if regex is incorrectly specified using capturing groups. ( #218 )
9 years ago
Kush Mansingh
0a192a1931
Add useEncodedPath option to router and routes ( #190 )
...
- Resolves a breaking change in #184
9 years ago
Richard Musiol
0b13a92220
Simplify extractVars, fixes edge cases. ( #185 )
...
Also make sure all regexp groups in tests are non-capturing.
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
JP Robinson
65c2651643
fixing regexp changes from PR #144
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
Tomasz Kłak
f48927253f
Named groups replaced with conditional wrapping of regexps
10 years ago
Shinya Kawaguchi
d17b93cab8
Refactoring for better performance
11 years ago
Shinya Kawaguchi
273db68971
Fix regexp syntax error caused by variable names containing any characters except letters, digits, and underscores
11 years ago
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
11 years ago
Kamil Kisiel
ba336c9cfb
getUrlQuery: Use SplitN with a max of 2.
11 years ago
Bay Dodd
fe40f0d056
updating query match string
11 years ago
Bay Dodd
19f0a91c4e
adding test and updating condition
11 years ago
Bay Dodd
2b32409792
fix for empty query
11 years ago
Bay Dodd
0c9d5c08c1
refactoring
11 years ago
Bay Dodd
a710a8bfa9
adding ^ and $ to query pattern
11 years ago
Felipe Madrigal
d7e4639818
Rearrange rules for matching strict slash
11 years ago
Felipe Madrigal
8df3a80fb8
Rearrange getHost function
11 years ago
Raphael Simon
451fd8b779
Additional code cleanup (see comments on issue #56 )
12 years ago
Raphael Simon
69237eaae5
Fix "Queries" matcher to support out-of-order query string parameters
12 years ago
Raphael Simon
65cc9b5df8
Add ability to capture variables in query strings
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
moraes
eac83ba2c0
Initial files.
13 years ago