python-engineio 4.10.0__py3-none-any.whl → 4.10.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
engineio/async_server.py CHANGED
@@ -269,11 +269,11 @@ class AsyncServer(base_server.BaseServer):
269
269
  'bad-jsonp-index')
270
270
  r = self._bad_request('Invalid JSONP index number')
271
271
  elif method == 'GET':
272
+ upgrade_header = environ.get('HTTP_UPGRADE').lower() \
273
+ if 'HTTP_UPGRADE' in environ else None
272
274
  if sid is None:
273
275
  # transport must be one of 'polling' or 'websocket'.
274
276
  # if 'websocket', the HTTP_UPGRADE header must match.
275
- upgrade_header = environ.get('HTTP_UPGRADE').lower() \
276
- if 'HTTP_UPGRADE' in environ else None
277
277
  if transport == 'polling' \
278
278
  or transport == upgrade_header == 'websocket':
279
279
  r = await self._handle_connect(environ, transport,
@@ -288,7 +288,8 @@ class AsyncServer(base_server.BaseServer):
288
288
  r = self._bad_request('Invalid session ' + sid)
289
289
  else:
290
290
  socket = self._get_socket(sid)
291
- if self.transport(sid) != transport:
291
+ if self.transport(sid) != transport and \
292
+ transport != upgrade_header:
292
293
  self._log_error_once(
293
294
  'Invalid transport for session ' + sid,
294
295
  'bad-transport')
engineio/server.py CHANGED
@@ -251,11 +251,11 @@ class Server(base_server.BaseServer):
251
251
  'bad-jsonp-index')
252
252
  r = self._bad_request('Invalid JSONP index number')
253
253
  elif method == 'GET':
254
+ upgrade_header = environ.get('HTTP_UPGRADE').lower() \
255
+ if 'HTTP_UPGRADE' in environ else None
254
256
  if sid is None:
255
257
  # transport must be one of 'polling' or 'websocket'.
256
258
  # if 'websocket', the HTTP_UPGRADE header must match.
257
- upgrade_header = environ.get('HTTP_UPGRADE').lower() \
258
- if 'HTTP_UPGRADE' in environ else None
259
259
  if transport == 'polling' \
260
260
  or transport == upgrade_header == 'websocket':
261
261
  r = self._handle_connect(environ, start_response,
@@ -270,7 +270,8 @@ class Server(base_server.BaseServer):
270
270
  r = self._bad_request('Invalid session')
271
271
  else:
272
272
  socket = self._get_socket(sid)
273
- if self.transport(sid) != transport:
273
+ if self.transport(sid) != transport and \
274
+ transport != upgrade_header:
274
275
  self._log_error_once(
275
276
  'Invalid transport for session ' + sid,
276
277
  'bad-transport')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-engineio
3
- Version: 4.10.0
3
+ Version: 4.10.1
4
4
  Summary: Engine.IO server and client for Python
5
5
  Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/miguelgrinberg/python-engineio
@@ -1,6 +1,6 @@
1
1
  engineio/__init__.py,sha256=0R2PY1EXu3sicP7mkA0_QxEVGRlFlgvsxfhByqREE1A,481
2
2
  engineio/async_client.py,sha256=jC7T6r_ya9LV46q4OdIQ041-3uLlRr6aUt__YmHNPEM,27950
3
- engineio/async_server.py,sha256=q29JCvIpCriUXZoqHwjJUwV2bK2MRypMQptROGw6imI,25738
3
+ engineio/async_server.py,sha256=Z1mpQxbu--hAQCY78BStsTlyP3_XUJ9zm0R51ziPOHI,25792
4
4
  engineio/async_socket.py,sha256=P8OZW1N5y7jr2hW1qLLK2y_Clt7aHdv2ucYW69mbU4Q,10305
5
5
  engineio/base_client.py,sha256=Q_w0Stvy89wPHwWk7411dRxpGjxNPypm4xy_4XMPZ9M,4872
6
6
  engineio/base_server.py,sha256=Em2RRpbohulKjmYTWHnf_lALKvTT_jHr442Rr2g_BEQ,14013
@@ -11,7 +11,7 @@ engineio/json.py,sha256=SG5FTojqd1ix6u0dKXJsZVqqdYioZLO4S2GPL7BKl3U,405
11
11
  engineio/middleware.py,sha256=BF_qHAIZZnIbfiP256SD1CX3kzNWbSuto1cpih8oIFg,3766
12
12
  engineio/packet.py,sha256=ETMeLgdpZghXK9fth93IZO8pIft6Sg3d1QGpyTx4xBE,3189
13
13
  engineio/payload.py,sha256=2iLIFgIweTWkLok_UZ5zCgELmRSGyUUI5eeYcEerFSs,1547
14
- engineio/server.py,sha256=v0QnoLCD1ReVAhzQRn5keHmjZ61jEJXNQeikfXaELl0,21926
14
+ engineio/server.py,sha256=Ub21Jf-9mxSPPYmWJMnzuGZRz6fRQc6rdtqcBKHHd-M,21980
15
15
  engineio/socket.py,sha256=dasec3jXoV2eR1jmIrhEIfHzyUuuv8FwvxLB3DpyjeY,9996
16
16
  engineio/static_files.py,sha256=pwez9LQFaSQXMbtI0vLyD6UDiokQ4rNfmRYgVLKOthc,2064
17
17
  engineio/async_drivers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -24,8 +24,8 @@ engineio/async_drivers/gevent_uwsgi.py,sha256=cnjCsnDHTa6rKgwDKD6rLvIw1Yun-g4c1Q
24
24
  engineio/async_drivers/sanic.py,sha256=SY0HIp5DUHF7B55tJCBB_8qDjrRTD_FyNQ2cIwRIGR8,4538
25
25
  engineio/async_drivers/threading.py,sha256=ywmG59d4H6OHZjKarBN97-9BHEsRxFEz9YN-E9QAu_I,463
26
26
  engineio/async_drivers/tornado.py,sha256=9bB7FvY47Snx_h4rsNwRk5wIINf2ju7hXWTAqF3intA,5909
27
- python_engineio-4.10.0.dist-info/LICENSE,sha256=yel9Pbwfu82094CLKCzWRtuIev9PUxP-a76NTDFAWpw,1082
28
- python_engineio-4.10.0.dist-info/METADATA,sha256=SaBVFlF_cqRa2i_sQ3Fdiaz6GdxT1qASxZpSugLD57A,2245
29
- python_engineio-4.10.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
30
- python_engineio-4.10.0.dist-info/top_level.txt,sha256=u8PmNisCZLwRYcWrNLe9wutQ2tt4zNi8IH362c-HWuA,9
31
- python_engineio-4.10.0.dist-info/RECORD,,
27
+ python_engineio-4.10.1.dist-info/LICENSE,sha256=yel9Pbwfu82094CLKCzWRtuIev9PUxP-a76NTDFAWpw,1082
28
+ python_engineio-4.10.1.dist-info/METADATA,sha256=DgLfc2h42WxGM1yarou6HGfgGUW1Bf89yglgjPb01qQ,2245
29
+ python_engineio-4.10.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
30
+ python_engineio-4.10.1.dist-info/top_level.txt,sha256=u8PmNisCZLwRYcWrNLe9wutQ2tt4zNi8IH362c-HWuA,9
31
+ python_engineio-4.10.1.dist-info/RECORD,,