From: Kenneth Reitz Date: Tue, 4 Oct 2011 15:33:11 +0000 (-0400) Subject: Add a trailing slash for twitter.com X-Git-Tag: v0.8.0~94^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04bcb74970c49ea6bda3881cb02beed2e3359b7b;p=services%2Fpython-requests.git Add a trailing slash for twitter.com --- diff --git a/requests/utils.py b/requests/utils.py index 0a11476..832a11f 100644 --- 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')