Update urllib3 to 4fb351cd2
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Donald Stufft · committed by Donald Stufft · parent 07f9a7e · Browse files · 3 files·+15 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+15 added−8 removed
- other:+15 added−8 removed
Provenance
- Commit
626c48e- Tree
a576366- Author
Donald Stufft <donald@stufft.io>- Committer
Donald Stufft <donald@stufft.io>- Parent
07f9a7e
3 files changed+15 added−8 removed
modified:requests/packages/urllib3/__init__.py+1 added-1 removed
8 unmodified lines9 """10 11 __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'12 __license__ = 'MIT'13-__version__ = '1.8.2'13+__version__ = 'dev'14 15 16 from .connectionpool import (17 HTTPConnectionPool,41 unmodified linesmodified:requests/packages/urllib3/connection.py+13 added-6 removed
93 unmodified lines94 return conn95 96 def _prepare_conn(self, conn):97 self.sock = conn98- if self._tunnel_host:98+ # the _tunnel_host attribute was added in python 2.6.3 (via99+ # http://hg.python.org/cpython/rev/0f57b30a152f) so pythons 2.6(0-2) do100+ # not have them.101+ if getattr(self, '_tunnel_host', None):102 # TODO: Fix tunnel so it doesn't depend on self.sock state.103 self._tunnel()104 105 def connect(self):61 unmodified lines167 168 resolved_cert_reqs = resolve_cert_reqs(self.cert_reqs)169 resolved_ssl_version = resolve_ssl_version(self.ssl_version)170 168- # the _tunnel_host attribute was added in python 2.6.3 (via169- # http://hg.python.org/cpython/rev/0f57b30a152f) so pythons 2.6(0-2) do170- # not have them.171+ hostname = self.host172 if getattr(self, '_tunnel_host', None):173+ # _tunnel_host was added in Python 2.6.3174+ # (See: http://hg.python.org/cpython/rev/0f57b30a152f)175+176 self.sock = sock177 # Calls self._set_hostport(), so self.host is178 # self._tunnel_host below.179 self._tunnel()180 181+ # Override the host with the one we're requesting data from.182+ hostname = self._tunnel_host183+184 # Wrap socket using verification with the root certs in185 # trusted_root_certs186 self.sock = ssl_wrap_socket(sock, self.key_file, self.cert_file,187 cert_reqs=resolved_cert_reqs,188 ca_certs=self.ca_certs,182- server_hostname=self.host,189+ server_hostname=hostname,190 ssl_version=resolved_ssl_version)191 192 if resolved_cert_reqs != ssl.CERT_NONE:193 if self.assert_fingerprint:194 assert_fingerprint(self.sock.getpeercert(binary_form=True),195 self.assert_fingerprint)196 elif self.assert_hostname is not False:197 match_hostname(self.sock.getpeercert(),191- self.assert_hostname or self.host)198+ self.assert_hostname or hostname)199 200 201 if ssl:202 # Make a copy for testing.2 unmodified linesmodified:requests/packages/urllib3/fields.py+1 added-1 removed
13 unmodified lines14 """15 Guess the "Content-Type" of a file.16 17 :param filename:18- The filename to guess the "Content-Type" of using :mod:`mimetimes`.18+ The filename to guess the "Content-Type" of using :mod:`mimetypes`.19 :param default:20 If no "Content-Type" can be guessed, default to `default`.21 """22 if filename:155 unmodified lines