Skip to content

Commit

Permalink
Set Content-Type explicitly to avoid guessing issues
Browse files Browse the repository at this point in the history
On Linux it detects py-file as `text/x-python`, but on Windows CI just
as `text/plain`.
  • Loading branch information
kxepal committed Jan 4, 2019
1 parent 0f4309f commit 74ad55e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,10 @@ async def test_reset_content_disposition_header(self, buf, stream):
"""
with open(__file__, 'rb') as fobj:
with aiohttp.MultipartWriter('form-data', boundary=':') as writer:
part = writer.append(fobj)
part = writer.append(
fobj,
headers={CONTENT_TYPE: 'text/plain'},
)

content_length = part.size

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

assert headers == (
b'--:\r\n'
b'Content-Type: text/x-python\r\n'
b'Content-Type: text/plain\r\n'
b'Content-Disposition:'
b' attachments; filename="bug.py"; filename*=utf-8\'\'bug.py\r\n'
b'Content-Length: %s'
Expand Down

0 comments on commit 74ad55e

Please sign in to comment.