Skip to content
Myr

meh

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent f44bb31 · Browse files · 1 file+3 added−5 removed
This commit

State

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

Diff stats

1 file+3 added−5 removed

  • other:+3 added−5 removed

1 file+3 added−5 removed

modified:requests/adapters.py+3 added-5 removed
8 unmodified lines
9"""10import os11from .models import Response12from .packages.urllib3.poolmanager import PoolManager13from .utils import DEFAULT_CA_BUNDLE_PATH13from .utils import DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers1415import socket16from .structures import CaseInsensitiveDict17from .packages.urllib3.exceptions import MaxRetryError, LocationParseError
24 unmodified lines
424344class HTTPAdapter(BaseAdapter):45 """Built-In HTTP Adapter for Urllib3."""46 def __init__(self,47 pool_connections=DEFAULT_POOLSIZE,48 pool_maxsize=DEFAULT_POOLSIZE):46 def __init__(self, pool_connections=DEFAULT_POOLSIZE, pool_maxsize=DEFAULT_POOLSIZE):47 self.max_retries = DEFAULT_RETRIES48 self.config = {}4950 super(HTTPAdapter, self).__init__()
49 unmodified lines
100 # Make headers case-insensitive.101 response.headers = CaseInsensitiveDict(getattr(resp, 'headers', {}))102103 # Set encoding.106 # response.encoding = get_encoding_from_headers(response.headers)104 response.encoding = get_encoding_from_headers(response.headers)105 response.raw = resp106107 if isinstance(req.url, bytes):108 response.url = req.url.decode('utf-8')
64 unmodified lines