Skip to content

Commit 814ff84

Browse files
Move python-engineio dependency to versions 3.8 and up
1 parent 0f42c18 commit 814ff84

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

docs/server.rst

+24-6
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Socket.IO servers to integrate easily into existing WSGI or ASGI applications::
5959
Serving Static Files
6060
--------------------
6161

62-
This package offers the option to configure the serving of static files. This
62+
The Engine.IO server can be configured to serve static files to clients. This
6363
is particularly useful to deliver HTML, CSS and JavaScript files to clients
6464
when this package is used without a companion web framework.
6565

@@ -91,20 +91,38 @@ If desired, an explicit content type for a static file can be given as follows::
9191
'/': {'filename': 'latency.html', 'content_type': 'text/plain'},
9292
}
9393

94-
Finally, it is also possible to configure an entire directory in a single rule,
95-
so that all the files in it are served as static files::
94+
It is also possible to configure an entire directory in a single rule, so that all
95+
the files in it are served as static files::
9696

9797
static_files = {
9898
'/static': './public',
99-
'/': './public/index.html',
10099
}
101100

102101
In this example any files with URLs starting with ``/static`` will be served
103102
directly from the ``public`` folder in the current directory, so for example,
104103
the URL ``/static/index.html`` will return local file ``./public/index.html``
105104
and the URL ``/static/css/styles.css`` will return local file
106-
``./public/css/styles.css``. The second rule creates a default mapping for the
107-
``index.html`` file when the root URL is requested.
105+
``./public/css/styles.css``.
106+
107+
If a URL that ends in a ``/`` is requested, then a default filename of
108+
``index.html`` is appended to it. In the previous example, a request for the
109+
``/static/`` URL would return local file ``./public/index.html``. The default
110+
filename to serve for slash-ending URLs can be set in the static files
111+
dictionary with an empty key::
112+
113+
static_files = {
114+
'/static': './public',
115+
'': 'image.gif',
116+
}
117+
118+
With this configuration, a request for ``/static/`` would return
119+
local file ``./public/image.gif``. A non-standard content type can also be
120+
specified if needed::
121+
122+
static_files = {
123+
'/static': './public',
124+
'': {'filename': 'image.gif', 'content_type': 'text/plain'},
125+
}
108126

109127
The static file configuration dictionary is given as the ``static_files``
110128
argument to the ``socketio.WSGIApp`` or ``socketio.ASGIApp`` classes::

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
platforms='any',
3131
install_requires=[
3232
'six>=1.9.0',
33-
'python-engineio>=3.2.0'
33+
'python-engineio>=3.8.0'
3434
],
3535
extras_require={
3636
'client': [

tests/common/test_middleware.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ def test_404(self):
3737
environ = {'PATH_INFO': '/foo/bar'}
3838
start_response = mock.MagicMock()
3939
r = m(environ, start_response)
40-
self.assertEqual(r, ['Not Found'])
40+
self.assertEqual(r, [b'Not Found'])
4141
start_response.assert_called_once_with(
42-
"404 Not Found", [('Content-type', 'text/plain')])
42+
"404 Not Found", [('Content-Type', 'text/plain')])

0 commit comments

Comments
 (0)