Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
avoid surprising aiohttp with unexpected kwargs
  • Loading branch information
chlowell committed Jul 15, 2019
commit c7a897aec68e371c41c0085da609336a2f577f64
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