Skip to content

Commit

Permalink
Merge pull request #2223 from blueyed/doc-followup-2222
Browse files Browse the repository at this point in the history
Document skipping in PreparedRequest; followup to #2222
  • Loading branch information
sigmavirus24 committed Sep 12, 2014
2 parents 1a44a99 + bff8b91 commit 9b41308
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ def prepare_url(self, url, params):
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
Expand Down
2 changes: 1 addition & 1 deletion test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def test_autoset_header_values_are_native(self):

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',
Expand Down

0 comments on commit 9b41308

Please sign in to comment.