Skip to content

Commit

Permalink
Pass arguments from instance dict to urlopen in HTTPAdapter.send
Browse files Browse the repository at this point in the history
  • Loading branch information
joren485 committed Sep 12, 2023
1 parent 8812812 commit c3fb480
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/requests/adapters.py
Expand Up @@ -130,6 +130,7 @@ class HTTPAdapter(BaseAdapter):
"_pool_connections",
"_pool_maxsize",
"_pool_block",
"urllib3_response_options",
]

def __init__(
Expand All @@ -154,6 +155,8 @@ def __init__(

self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block)

self.urllib3_response_options = {}

def __getstate__(self):
return {attr: getattr(self, attr, None) for attr in self.__attrs__}

Expand Down Expand Up @@ -494,6 +497,7 @@ def send(
retries=self.max_retries,
timeout=timeout,
chunked=chunked,
**self.urllib3_response_options,
)

except (ProtocolError, OSError) as err:
Expand Down

0 comments on commit c3fb480

Please sign in to comment.