Skip to content

Commit 8896f85

Browse files
committed
Fix aiohttp typing
1 parent 98e2ebe commit 8896f85

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

msrest/universal_http/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from urllib.parse import urlparse
4141
import xml.etree.ElementTree as ET
4242

43-
from typing import TYPE_CHECKING, Generic, TypeVar, cast, IO, List, Union, Any, Mapping, Dict, Optional, Tuple, Callable, Iterator # pylint: disable=unused-import
43+
from typing import TYPE_CHECKING, Generic, TypeVar, cast, IO, List, Union, Any, Mapping, Dict, Optional, Tuple, Callable, Iterator, MutableMapping # pylint: disable=unused-import
4444

4545
HTTPResponseType = TypeVar("HTTPResponseType", bound='HTTPClientResponse')
4646

@@ -325,7 +325,7 @@ def __init__(self, request, internal_response):
325325
self.request = request
326326
self.internal_response = internal_response
327327
self.status_code = None # type: Optional[int]
328-
self.headers = {} # type: Dict[str, str]
328+
self.headers = {} # type: MutableMapping[str, str]
329329
self.reason = None # type: Optional[str]
330330

331331
def body(self):

msrest/universal_http/aiohttp.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from typing import Any, Callable, AsyncIterator, Optional
2727

2828
import aiohttp
29+
from multidict import CIMultiDict
2930

3031
from . import AsyncHTTPSender, ClientRequest, AsyncClientResponse
3132

@@ -69,7 +70,7 @@ def __init__(self, request: ClientRequest, aiohttp_response: aiohttp.ClientRespo
6970
super(AioHttpClientResponse, self).__init__(request, aiohttp_response)
7071
# https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientResponse
7172
self.status_code = aiohttp_response.status
72-
self.headers = aiohttp_response.headers
73+
self.headers = CIMultiDict(aiohttp_response.headers)
7374
self.reason = aiohttp_response.reason
7475
self._body = None
7576

0 commit comments

Comments
 (0)