Skip to content

Commit 66ccd6e

Browse files
committed
Set Content-Type explicitly to avoid guessing issues
On Linux it detects py-file as `text/x-python`, but on Windows CI just as `text/plain`.
1 parent f6a402e commit 66ccd6e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_multipart.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,10 @@ async def test_reset_content_disposition_header(self, buf, stream):
11171117
"""
11181118
with open(__file__, 'rb') as fobj:
11191119
with aiohttp.MultipartWriter('form-data', boundary=':') as writer:
1120-
part = writer.append(fobj)
1120+
part = writer.append(
1121+
fobj,
1122+
headers={CONTENT_TYPE: 'text/plain'},
1123+
)
11211124

11221125
content_length = part.size
11231126

@@ -1131,7 +1134,7 @@ async def test_reset_content_disposition_header(self, buf, stream):
11311134

11321135
assert headers == (
11331136
b'--:\r\n'
1134-
b'Content-Type: text/x-python\r\n'
1137+
b'Content-Type: text/plain\r\n'
11351138
b'Content-Disposition:'
11361139
b' attachments; filename="bug.py"; filename*=utf-8\'\'bug.py\r\n'
11371140
b'Content-Length: %s'

0 commit comments

Comments
 (0)