Merge "Allow all RFC3986-specified characters in explicit path segments."
This commit is contained in:
commit
cbcc8b3e51
|
@ -42,7 +42,9 @@ def route(*args):
|
|||
if not isinstance(route, six.string_types):
|
||||
raise TypeError('%s must be a string' % route)
|
||||
|
||||
if not re.match('^[0-9a-zA-Z-_$\(\),;:]+$', route):
|
||||
if route in ('.', '..') or not re.match(
|
||||
'^[0-9a-zA-Z-_$\(\)\.~!,;:*+@=]+$', route
|
||||
):
|
||||
raise ValueError(
|
||||
'%s must be a valid path segment. Keep in mind '
|
||||
'that path segments should not contain path separators '
|
||||
|
|
|
@ -2208,6 +2208,13 @@ class TestExplicitRoute(PecanTestCase):
|
|||
'path(with-parens)',
|
||||
'path;with;semicolons',
|
||||
'path:with:colons',
|
||||
'v2.0',
|
||||
'~username',
|
||||
'somepath!',
|
||||
'four*four',
|
||||
'one+two',
|
||||
'@twitterhandle',
|
||||
'package=pecan'
|
||||
):
|
||||
handler = C()
|
||||
route(C, path, handler)
|
||||
|
|
Loading…
Reference in New Issue