mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #2223 from blueyed/doc-followup-2222
Document skipping in PreparedRequest; followup to #2222
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user