diff options
author | Ian Cordasco <icordasc+github@coglib.com> | 2014-09-12 11:54:40 -0500 |
---|---|---|
committer | Ian Cordasco <icordasc+github@coglib.com> | 2014-09-12 11:54:40 -0500 |
commit | 9b41308b9f582dfa39db0ee57dc0b521a24538c2 (patch) | |
tree | b1616b96869b7140187fae577ec4ccd25527aaa3 | |
parent | 1a44a99f175d831487fe82985d1d4a4820cc355c (diff) | |
parent | bff8b91638586a8269f79f1bac6e82921702e5b3 (diff) | |
download | python-requests-9b41308b9f582dfa39db0ee57dc0b521a24538c2.tar.gz |
Merge pull request #2223 from blueyed/doc-followup-2222
Document skipping in PreparedRequest; followup to #2222
-rw-r--r-- | requests/models.py | 4 | ||||
-rwxr-xr-x | test_requests.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/requests/models.py b/requests/models.py index 03ff627a..bbf08c81 100644 --- a/requests/models.py +++ b/requests/models.py @@ -334,7 +334,9 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): except UnicodeDecodeError: pass - # Don't do any URL preparation for oddball schemes + # Don't do any URL preparation for non-HTTP schemes like `mailto`, + # `data` etc to work around exceptions from `url_parse`, which + # handles RFC 3986 only. if ':' in url and not url.lower().startswith('http'): self.url = url return diff --git a/test_requests.py b/test_requests.py index 9f75a9d9..4fccc346 100755 --- a/test_requests.py +++ b/test_requests.py @@ -922,7 +922,7 @@ class RequestsTestCase(unittest.TestCase): assert p.headers['Content-Length'] == length - def test_oddball_schemes_dont_check_URLs(self): + def test_nonhttp_schemes_dont_check_URLs(self): test_urls = ( 'data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw==', 'file:///etc/passwd', |