Added ability to check if missing trailing slash in path.

Previously this URL would not work:

    http://example.com?foo=bar

But this URL would work:

    http://example.com/?foo=bar

Even though a slash is required for a valid URL, it is a common use case
for the slash to be left out, so it would be a good idea to account for this.
This commit is contained in:
Brendon Crawford
2012-01-29 23:24:54 -08:00
parent 319b1ed551
commit c363ca476f
+3
View File
@@ -317,6 +317,9 @@ class Request(object):
netloc = netloc.encode('idna').decode('utf-8')
if not path:
path = '/'
if is_py2:
if isinstance(path, str):
path = path.encode('utf-8')