Skip to content
Myr

Document skipping in PreparedRequest; followup to #2222

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Hahler · committed by Daniel Hahler · parent 1a44a99 · Browse files · 2 files+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−2 removed

  • other:+4 added−2 removed

2 files+4 added−2 removed

modified:requests/models.py+3 added-1 removed
332 unmodified lines
333 url = str(url)334 except UnicodeDecodeError:335 pass336337 # Don't do any URL preparation for oddball schemes337 # Don't do any URL preparation for non-HTTP schemes like `mailto`,338 # `data` etc to work around exceptions from `url_parse`, which339 # handles RFC 3986 only.340 if ':' in url and not url.lower().startswith('http'):341 self.url = url342 return343
475 unmodified lines
modified:test_requests.py+1 added-1 removed
920 unmodified lines
921 p = req.prepare()922923 assert p.headers['Content-Length'] == length924925 def test_oddball_schemes_dont_check_URLs(self):925 def test_nonhttp_schemes_dont_check_URLs(self):926 test_urls = (927 'data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw==',928 'file:///etc/passwd',929 'magnet:?xt=urn:btih:be08f00302bc2d1d3cfa3af02024fa647a271431',
567 unmodified lines