Skip to content

Commit c2603e9

Browse files
authored
Use plaintext Content-Type when using polling (#248)
1 parent 38c90ed commit c2603e9

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/engineio/asyncio_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ async def _write_loop(self):
586586
p = payload.Payload(packets=packets)
587587
r = await self._send_request(
588588
'POST', self.base_url, body=p.encode(),
589-
headers={'Content-Type': 'application/octet-stream'},
589+
headers={'Content-Type': 'text/plain'},
590590
timeout=self.request_timeout)
591591
for pkt in packets:
592592
self.queue.task_done()

src/engineio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ def _write_loop(self):
680680
p = payload.Payload(packets=packets)
681681
r = self._send_request(
682682
'POST', self.base_url, body=p.encode(),
683-
headers={'Content-Type': 'application/octet-stream'},
683+
headers={'Content-Type': 'text/plain'},
684684
timeout=self.request_timeout)
685685
for pkt in packets:
686686
self.queue.task_done()

tests/asyncio/test_asyncio_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ def test_write_loop_polling_one_packet(self):
12111211
'POST',
12121212
'http://foo',
12131213
body=p.encode(),
1214-
headers={'Content-Type': 'application/octet-stream'},
1214+
headers={'Content-Type': 'text/plain'},
12151215
timeout=5,
12161216
)
12171217

@@ -1252,7 +1252,7 @@ def test_write_loop_polling_three_packets(self):
12521252
'POST',
12531253
'http://foo',
12541254
body=p.encode(),
1255-
headers={'Content-Type': 'application/octet-stream'},
1255+
headers={'Content-Type': 'text/plain'},
12561256
timeout=5,
12571257
)
12581258

@@ -1288,7 +1288,7 @@ def test_write_loop_polling_two_packets_done(self):
12881288
'POST',
12891289
'http://foo',
12901290
body=p.encode(),
1291-
headers={'Content-Type': 'application/octet-stream'},
1291+
headers={'Content-Type': 'text/plain'},
12921292
timeout=5,
12931293
)
12941294
assert c.state == 'connected'
@@ -1316,7 +1316,7 @@ def test_write_loop_polling_bad_connection(self):
13161316
'POST',
13171317
'http://foo',
13181318
body=p.encode(),
1319-
headers={'Content-Type': 'application/octet-stream'},
1319+
headers={'Content-Type': 'text/plain'},
13201320
timeout=5,
13211321
)
13221322
assert c.state == 'connected'
@@ -1345,7 +1345,7 @@ def test_write_loop_polling_bad_status(self):
13451345
'POST',
13461346
'http://foo',
13471347
body=p.encode(),
1348-
headers={'Content-Type': 'application/octet-stream'},
1348+
headers={'Content-Type': 'text/plain'},
13491349
timeout=5,
13501350
)
13511351
assert c.state == 'disconnected'

tests/common/test_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ def test_write_loop_polling_one_packet(self):
14661466
'POST',
14671467
'http://foo',
14681468
body=p.encode(),
1469-
headers={'Content-Type': 'application/octet-stream'},
1469+
headers={'Content-Type': 'text/plain'},
14701470
timeout=5,
14711471
)
14721472

@@ -1501,7 +1501,7 @@ def test_write_loop_polling_three_packets(self):
15011501
'POST',
15021502
'http://foo',
15031503
body=p.encode(),
1504-
headers={'Content-Type': 'application/octet-stream'},
1504+
headers={'Content-Type': 'text/plain'},
15051505
timeout=5,
15061506
)
15071507

@@ -1534,7 +1534,7 @@ def test_write_loop_polling_two_packets_done(self):
15341534
'POST',
15351535
'http://foo',
15361536
body=p.encode(),
1537-
headers={'Content-Type': 'application/octet-stream'},
1537+
headers={'Content-Type': 'text/plain'},
15381538
timeout=5,
15391539
)
15401540
assert c.state == 'connected'
@@ -1563,7 +1563,7 @@ def test_write_loop_polling_bad_connection(self):
15631563
'POST',
15641564
'http://foo',
15651565
body=p.encode(),
1566-
headers={'Content-Type': 'application/octet-stream'},
1566+
headers={'Content-Type': 'text/plain'},
15671567
timeout=5,
15681568
)
15691569
assert c.state == 'connected'
@@ -1592,7 +1592,7 @@ def test_write_loop_polling_bad_status(self):
15921592
'POST',
15931593
'http://foo',
15941594
body=p.encode(),
1595-
headers={'Content-Type': 'application/octet-stream'},
1595+
headers={'Content-Type': 'text/plain'},
15961596
timeout=5,
15971597
)
15981598
assert c.state == 'disconnected'

0 commit comments

Comments
 (0)