Skip to content

Commit

Permalink
Avoid surprising aiohttp with unexpected kwargs (#6355)
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell authored Jul 16, 2019
1 parent 1dd0602 commit 26a7f15
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ async def close(self):
self._session_owner = False
self.session = None

def _build_ssl_config(self, **config):
verify = config.get('connection_verify', self.config.connection.verify)
cert = config.get('connection_cert', self.config.connection.cert)
def _build_ssl_config(self, cert, verify):
ssl_ctx = None

if cert or verify not in (True, False):
Expand Down Expand Up @@ -144,15 +142,18 @@ async def send(self, request: HttpRequest, **config: Any) -> Optional[AsyncHttpR
await self.open()
error = None
response = None
config['ssl'] = self._build_ssl_config(**config)
config['ssl'] = self._build_ssl_config(
cert=config.pop('connection_cert', self.config.connection.cert),
verify=config.pop('connection_verify', self.config.connection.verify)
)
try:
stream_response = config.pop("stream", False)
result = await self.session.request(
request.method,
request.url,
headers=request.headers,
data=self._get_request_data(request),
timeout=config.get('connection_timeout', self.config.connection.timeout),
timeout=config.pop('connection_timeout', self.config.connection.timeout),
allow_redirects=False,
**config
)
Expand Down

0 comments on commit 26a7f15

Please sign in to comment.