Skip to content

Commit 9b41308

Browse files
committed
Merge pull request #2223 from blueyed/doc-followup-2222
Document skipping in PreparedRequest; followup to #2222
2 parents 1a44a99 + bff8b91 commit 9b41308

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

requests/models.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,9 @@ def prepare_url(self, url, params):
334334
except UnicodeDecodeError:
335335
pass
336336

337-
# Don't do any URL preparation for oddball schemes
337+
# Don't do any URL preparation for non-HTTP schemes like `mailto`,
338+
# `data` etc to work around exceptions from `url_parse`, which
339+
# handles RFC 3986 only.
338340
if ':' in url and not url.lower().startswith('http'):
339341
self.url = url
340342
return

test_requests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ def test_autoset_header_values_are_native(self):
922922

923923
assert p.headers['Content-Length'] == length
924924

925-
def test_oddball_schemes_dont_check_URLs(self):
925+
def test_nonhttp_schemes_dont_check_URLs(self):
926926
test_urls = (
927927
'data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw==',
928928
'file:///etc/passwd',

0 commit comments

Comments
 (0)