From 04bcb74970c49ea6bda3881cb02beed2e3359b7b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 4 Oct 2011 11:33:11 -0400 Subject: [PATCH] Add a trailing slash for twitter.com --- requests/utils.py | 4 ++++ 1 file changed, 4 insertions(+) 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') -- 2.34.1