Skip to content
Myr

Make sure that url has fragment removed when using a proxy

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

authored by Jonathan Halcrow · committed by Jonathan Halcrow · parent 6e0ad1e · Browse files · 2 files+6 added−4 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+6 added−4 removed

  • other:+6 added−4 removed

2 files+6 added−4 removed

modified:requests/compat.py+2 added-2 removed
82 unmodified lines
838485if is_py2:86 from urllib import quote, unquote, quote_plus, unquote_plus, urlencode87 from urlparse import urlparse, urlunparse, urljoin, urlsplit87 from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag88 from urllib2 import parse_http_list89 import cookielib90 from Cookie import Morsel91 from StringIO import StringIO
11 unmodified lines
103104105106elif is_py3:107 from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus107 from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag108 from urllib.request import parse_http_list109 from http import cookiejar as cookielib110 from http.cookies import Morsel111 from io import StringIO
8 unmodified lines
modified:requests/models.py+4 added-2 removed
32 unmodified lines
33 stream_decode_response_unicode, get_netrc_auth, get_environ_proxies,34 to_key_val_list, DEFAULT_CA_BUNDLE_PATH, parse_header_links, iter_slices)35from .compat import (36 cookielib, urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,37 StringIO, is_py2, chardet, json, builtin_str)37 StringIO, is_py2, chardet, json, builtin_str, urldefrag)3839REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)40CONTENT_CHUNK_SIZE = 10 * 102441
402 unmodified lines
444 p = urlsplit(self.full_url)445446 # Proxies use full URLs.447 if p.scheme in self.proxies:448 return self.full_url448 url_base, frag = urldefrag(self.full_url)449 return url_base450451452 path = p.path453 if not path:454 path = '/'455
439 unmodified lines