projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
319b1ed
)
Added ability to check if missing trailing slash in path.
author
Brendon Crawford
<brendon@aphexcreations.net>
Mon, 30 Jan 2012 07:24:54 +0000
(23:24 -0800)
committer
Brendon Crawford
<brendon@aphexcreations.net>
Mon, 30 Jan 2012 07:24:54 +0000
(23:24 -0800)
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.
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index 7ac85cc09b087d2efac69d33e5f74f16b2431f7e..6fdf8bb0a82133289183a7f09895d5c376b793f9 100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-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')