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:
6e90aa7
)
Add a trailing slash for twitter.com
author
Kenneth Reitz
<me@kennethreitz.com>
Tue, 4 Oct 2011 15:33:11 +0000
(11:33 -0400)
committer
Kenneth Reitz
<me@kennethreitz.com>
Tue, 4 Oct 2011 15:33:11 +0000
(11:33 -0400)
requests/utils.py
patch
|
blob
|
history
diff --git
a/requests/utils.py
b/requests/utils.py
index 0a114768b19545eb6c30407b06330cb32b4b9358..832a11f3524ea31d2b1d5576c268025ba2ffda4f 100644
(file)
--- a/
requests/utils.py
+++ b/
requests/utils.py
@@
-54,6
+54,10
@@
def cleanup_url(url, parent_url=None):
if netloc:
netloc = netloc.encode('idna')
+ # Add a trailing slash to root domain reqests.
+ if not len(path):
+ path = '/'
+
if isinstance(path, unicode):
path = path.encode('utf-8')