fix(Request): Allow for query param names with dots

This commit is contained in:
Soren Hansen
2013-08-29 22:26:02 +02:00
parent 849fca4c38
commit bee930d022
2 changed files with 3 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ limitations under the License.
import re
QS_PATTERN = re.compile(r'(?<![0-9])([a-zA-Z][a-zA-Z_0-9\-]*)=([^&]+)')
QS_PATTERN = re.compile(r'(?<![0-9])([a-zA-Z][a-zA-Z_0-9\-.]*)=([^&]+)')
"""Match query string fields that have names which start with a letter."""

View File

@@ -47,7 +47,7 @@ class TestQueryParams(testing.TestBase):
def test_allowed_names(self):
query_string = ('p=0&p1=23&2p=foo&some-thing=that&blank=&some_thing=x&'
'-bogus=foo')
'-bogus=foo&more.things=blah')
self.simulate_request('/', query_string=query_string)
req = self.resource.req
@@ -58,6 +58,7 @@ class TestQueryParams(testing.TestBase):
self.assertIs(req.get_param('blank'), None)
self.assertEquals(req.get_param('some_thing'), 'x')
self.assertIs(req.get_param('-bogus'), None)
self.assertEquals(req.get_param('more.things'), 'blah')
def test_required(self):
query_string = ''