python-engineio 4.11.2__tar.gz → 4.12.0__tar.gz
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.
- {python_engineio-4.11.2/src/python_engineio.egg-info → python_engineio-4.12.0}/PKG-INFO +3 -2
- {python_engineio-4.11.2 → python_engineio-4.12.0}/pyproject.toml +1 -1
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/base_server.py +20 -16
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/packet.py +3 -3
- {python_engineio-4.11.2 → python_engineio-4.12.0/src/python_engineio.egg-info}/PKG-INFO +3 -2
- {python_engineio-4.11.2 → python_engineio-4.12.0}/LICENSE +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/MANIFEST.in +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/README.md +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/Makefile +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/_static/README.md +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/api.rst +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/client.rst +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/conf.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/index.rst +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/intro.rst +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/make.bat +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/docs/server.rst +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/setup.cfg +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/__init__.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_client.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/__init__.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/_websocket_wsgi.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/aiohttp.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/asgi.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/eventlet.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/gevent.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/gevent_uwsgi.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/sanic.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/threading.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/tornado.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_server.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_socket.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/base_client.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/base_socket.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/client.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/exceptions.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/json.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/middleware.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/payload.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/server.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/socket.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/static_files.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/python_engineio.egg-info/SOURCES.txt +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/python_engineio.egg-info/dependency_links.txt +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/python_engineio.egg-info/not-zip-safe +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/python_engineio.egg-info/requires.txt +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/src/python_engineio.egg-info/top_level.txt +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/__init__.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/__init__.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/index.html +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/test_aiohttp.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/test_asgi.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/test_client.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/test_sanic.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/test_server.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/test_socket.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/async/test_tornado.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/__init__.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/index.html +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/test_client.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/test_middleware.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/test_packet.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/test_payload.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/test_server.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/common/test_socket.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/README.md +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/binary_b64_packet.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/binary_packet.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/json_packet.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/payload.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/run.sh +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/server_receive.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tests/performance/text_packet.py +0 -0
- {python_engineio-4.11.2 → python_engineio-4.12.0}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-engineio
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.12.0
|
|
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
|
|
@@ -21,6 +21,7 @@ Provides-Extra: asyncio-client
|
|
|
21
21
|
Requires-Dist: aiohttp>=3.4; extra == "asyncio-client"
|
|
22
22
|
Provides-Extra: docs
|
|
23
23
|
Requires-Dist: sphinx; extra == "docs"
|
|
24
|
+
Dynamic: license-file
|
|
24
25
|
|
|
25
26
|
python-engineio
|
|
26
27
|
===============
|
|
@@ -282,29 +282,33 @@ class BaseServer:
|
|
|
282
282
|
'response': message.encode('utf-8')}
|
|
283
283
|
|
|
284
284
|
def _cors_allowed_origins(self, environ):
|
|
285
|
-
default_origins = []
|
|
286
|
-
if 'wsgi.url_scheme' in environ and 'HTTP_HOST' in environ:
|
|
287
|
-
default_origins.append('{scheme}://{host}'.format(
|
|
288
|
-
scheme=environ['wsgi.url_scheme'], host=environ['HTTP_HOST']))
|
|
289
|
-
if 'HTTP_X_FORWARDED_PROTO' in environ or \
|
|
290
|
-
'HTTP_X_FORWARDED_HOST' in environ:
|
|
291
|
-
scheme = environ.get(
|
|
292
|
-
'HTTP_X_FORWARDED_PROTO',
|
|
293
|
-
environ['wsgi.url_scheme']).split(',')[0].strip()
|
|
294
|
-
default_origins.append('{scheme}://{host}'.format(
|
|
295
|
-
scheme=scheme, host=environ.get(
|
|
296
|
-
'HTTP_X_FORWARDED_HOST', environ['HTTP_HOST']).split(
|
|
297
|
-
',')[0].strip()))
|
|
298
285
|
if self.cors_allowed_origins is None:
|
|
299
|
-
allowed_origins =
|
|
286
|
+
allowed_origins = []
|
|
287
|
+
if 'wsgi.url_scheme' in environ and 'HTTP_HOST' in environ:
|
|
288
|
+
allowed_origins.append('{scheme}://{host}'.format(
|
|
289
|
+
scheme=environ['wsgi.url_scheme'],
|
|
290
|
+
host=environ['HTTP_HOST']))
|
|
291
|
+
if 'HTTP_X_FORWARDED_PROTO' in environ or \
|
|
292
|
+
'HTTP_X_FORWARDED_HOST' in environ:
|
|
293
|
+
scheme = environ.get(
|
|
294
|
+
'HTTP_X_FORWARDED_PROTO',
|
|
295
|
+
environ['wsgi.url_scheme']).split(',')[0].strip()
|
|
296
|
+
allowed_origins.append('{scheme}://{host}'.format(
|
|
297
|
+
scheme=scheme, host=environ.get(
|
|
298
|
+
'HTTP_X_FORWARDED_HOST',
|
|
299
|
+
environ['HTTP_HOST']).split(
|
|
300
|
+
',')[0].strip()))
|
|
300
301
|
elif self.cors_allowed_origins == '*':
|
|
301
302
|
allowed_origins = None
|
|
302
303
|
elif isinstance(self.cors_allowed_origins, str):
|
|
303
304
|
allowed_origins = [self.cors_allowed_origins]
|
|
304
305
|
elif callable(self.cors_allowed_origins):
|
|
305
306
|
origin = environ.get('HTTP_ORIGIN')
|
|
306
|
-
|
|
307
|
-
|
|
307
|
+
try:
|
|
308
|
+
is_allowed = self.cors_allowed_origins(origin, environ)
|
|
309
|
+
except TypeError:
|
|
310
|
+
is_allowed = self.cors_allowed_origins(origin)
|
|
311
|
+
allowed_origins = [origin] if is_allowed else []
|
|
308
312
|
else:
|
|
309
313
|
allowed_origins = self.cors_allowed_origins
|
|
310
314
|
return allowed_origins
|
|
@@ -72,11 +72,11 @@ class Packet:
|
|
|
72
72
|
else:
|
|
73
73
|
self.packet_type = int(encoded_packet[0])
|
|
74
74
|
try:
|
|
75
|
-
|
|
76
|
-
if isinstance(self.data, int):
|
|
75
|
+
if encoded_packet[1].isnumeric():
|
|
77
76
|
# do not allow integer payloads, see
|
|
78
77
|
# github.com/miguelgrinberg/python-engineio/issues/75
|
|
79
78
|
# for background on this decision
|
|
80
79
|
raise ValueError
|
|
81
|
-
|
|
80
|
+
self.data = self.json.loads(encoded_packet[1:])
|
|
81
|
+
except (ValueError, IndexError):
|
|
82
82
|
self.data = encoded_packet[1:]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-engineio
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.12.0
|
|
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
|
|
@@ -21,6 +21,7 @@ Provides-Extra: asyncio-client
|
|
|
21
21
|
Requires-Dist: aiohttp>=3.4; extra == "asyncio-client"
|
|
22
22
|
Provides-Extra: docs
|
|
23
23
|
Requires-Dist: sphinx; extra == "docs"
|
|
24
|
+
Dynamic: license-file
|
|
24
25
|
|
|
25
26
|
python-engineio
|
|
26
27
|
===============
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/_websocket_wsgi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_engineio-4.11.2 → python_engineio-4.12.0}/src/engineio/async_drivers/gevent_uwsgi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_engineio-4.11.2 → python_engineio-4.12.0}/src/python_engineio.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_engineio-4.11.2 → python_engineio-4.12.0}/src/python_engineio.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|