mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-18 19:27:06 +00:00
[python/asyncio] fix passing proxy parameters to aiohttp (#5943)
This commit is contained in:
@@ -65,16 +65,13 @@ class RESTClientObject(object):
|
||||
ssl=ssl_context
|
||||
)
|
||||
|
||||
self.proxy = configuration.proxy
|
||||
self.proxy_headers = configuration.proxy_headers
|
||||
|
||||
# https pool manager
|
||||
if configuration.proxy:
|
||||
self.pool_manager = aiohttp.ClientSession(
|
||||
connector=connector,
|
||||
proxy=configuration.proxy
|
||||
)
|
||||
else:
|
||||
self.pool_manager = aiohttp.ClientSession(
|
||||
connector=connector
|
||||
)
|
||||
self.pool_manager = aiohttp.ClientSession(
|
||||
connector=connector
|
||||
)
|
||||
|
||||
async def close(self):
|
||||
await self.pool_manager.close()
|
||||
@@ -122,6 +119,11 @@ class RESTClientObject(object):
|
||||
"headers": headers
|
||||
}
|
||||
|
||||
if self.proxy:
|
||||
args["proxy"] = self.proxy
|
||||
if self.proxy_headers:
|
||||
args["proxy_headers"] = self.proxy_headers
|
||||
|
||||
if query_params:
|
||||
args["url"] += '?' + urlencode(query_params)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user