File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -465,9 +465,10 @@ async def _prepare_headers(self) -> None:
465
465
version = request .version
466
466
467
467
headers = self ._headers
468
- for cookie in self ._cookies .values ():
469
- value = cookie .output (header = "" )[1 :]
470
- headers .add (hdrs .SET_COOKIE , value )
468
+ if self ._cookies :
469
+ for cookie in self ._cookies .values ():
470
+ value = cookie .output (header = "" )[1 :]
471
+ headers .add (hdrs .SET_COOKIE , value )
471
472
472
473
if self ._compression :
473
474
await self ._start_compression (request )
@@ -515,9 +516,8 @@ async def _prepare_headers(self) -> None:
515
516
if keep_alive :
516
517
if version == HttpVersion10 :
517
518
headers [hdrs .CONNECTION ] = "keep-alive"
518
- else :
519
- if version == HttpVersion11 :
520
- headers [hdrs .CONNECTION ] = "close"
519
+ elif version == HttpVersion11 :
520
+ headers [hdrs .CONNECTION ] = "close"
521
521
522
522
async def _write_headers (self ) -> None :
523
523
request = self ._req
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ def test_web___all__(pytester: pytest.Pytester) -> None:
49
49
not sys .platform .startswith ("linux" ) or platform .python_implementation () == "PyPy" ,
50
50
reason = "Timing is more reliable on Linux" ,
51
51
)
52
+ @pytest .mark .dev_mode
52
53
def test_import_time (pytester : pytest .Pytester ) -> None :
53
54
"""Check that importing aiohttp doesn't take too long.
54
55
You can’t perform that action at this time.
0 commit comments