Skip to content
Myr

Merge pull request #1888 from longaccess/handle301

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

Fix for 301 redirect and latest PyOpenSSL.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 19756d5, 8b792be · Browse files · 2 files+5 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+5 added−2 removed

  • other:+5 added−2 removed

2 files+5 added−2 removed

modified:requests/sessions.py+2 added-2 removed
15 unmodified lines
16from .cookies import (17 cookiejar_from_dict, extract_cookies_to_jar, RequestsCookieJar, merge_cookies)18from .models import Request, PreparedRequest19from .hooks import default_hooks, dispatch_hook20from .utils import to_key_val_list, default_headers20from .utils import to_key_val_list, default_headers, to_native_string21from .exceptions import TooManyRedirects, InvalidSchema22from .structures import CaseInsensitiveDict2324from .adapters import HTTPAdapter
95 unmodified lines
120 url = urljoin(resp.url, requote_uri(url))121 else:122 url = requote_uri(url)123124 prepared_request.url = url124 prepared_request.url = to_native_string(url)125126 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4127 if (resp.status_code == codes.see_other and128 method != 'HEAD'):
425 unmodified lines
modified:test_requests.py+3 added
410 unmodified lines
411412 def test_unicode_header_name(self):413 requests.put(httpbin('put'), headers={str('Content-Type'): 'application/octet-stream'}, data='\xff') # compat.str is unicode.414415 def test_pyopenssl_redirect(self):416 requests.get('https://httpbin.org/status/301')417418 def test_urlencoded_get_query_multivalued_param(self):419420 r = requests.get(httpbin('get'), params=dict(test=['foo', 'baz']))421 assert r.status_code == 200
752 unmodified lines