Skip to content

Commit

Permalink
Use plaintext Content-Type when using polling (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirkrypt0 authored Sep 17, 2021
1 parent 38c90ed commit c2603e9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/engineio/asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ async def _write_loop(self):
p = payload.Payload(packets=packets)
r = await self._send_request(
'POST', self.base_url, body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=self.request_timeout)
for pkt in packets:
self.queue.task_done()
Expand Down
2 changes: 1 addition & 1 deletion src/engineio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def _write_loop(self):
p = payload.Payload(packets=packets)
r = self._send_request(
'POST', self.base_url, body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=self.request_timeout)
for pkt in packets:
self.queue.task_done()
Expand Down
10 changes: 5 additions & 5 deletions tests/asyncio/test_asyncio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ def test_write_loop_polling_one_packet(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)

Expand Down Expand Up @@ -1252,7 +1252,7 @@ def test_write_loop_polling_three_packets(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)

Expand Down Expand Up @@ -1288,7 +1288,7 @@ def test_write_loop_polling_two_packets_done(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)
assert c.state == 'connected'
Expand Down Expand Up @@ -1316,7 +1316,7 @@ def test_write_loop_polling_bad_connection(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)
assert c.state == 'connected'
Expand Down Expand Up @@ -1345,7 +1345,7 @@ def test_write_loop_polling_bad_status(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)
assert c.state == 'disconnected'
Expand Down
10 changes: 5 additions & 5 deletions tests/common/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ def test_write_loop_polling_one_packet(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)

Expand Down Expand Up @@ -1501,7 +1501,7 @@ def test_write_loop_polling_three_packets(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)

Expand Down Expand Up @@ -1534,7 +1534,7 @@ def test_write_loop_polling_two_packets_done(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)
assert c.state == 'connected'
Expand Down Expand Up @@ -1563,7 +1563,7 @@ def test_write_loop_polling_bad_connection(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)
assert c.state == 'connected'
Expand Down Expand Up @@ -1592,7 +1592,7 @@ def test_write_loop_polling_bad_status(self):
'POST',
'http://foo',
body=p.encode(),
headers={'Content-Type': 'application/octet-stream'},
headers={'Content-Type': 'text/plain'},
timeout=5,
)
assert c.state == 'disconnected'
Expand Down

0 comments on commit c2603e9

Please sign in to comment.