Skip to content

Commit 045188c

Browse files
Documentation for the Same Origin security policy
1 parent 8643f56 commit 045188c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

docs/server.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,3 +823,23 @@ multiple servers, the following conditions must be met:
823823
- The worker processes need to communicate with each other to coordinate
824824
complex operations such as broadcasts. This is done through a configured
825825
message queue. See the section on using message queues for details.
826+
827+
Cross-Origin Controls
828+
---------------------
829+
830+
For security reasons, this server enforces a same-origin policy by default. In
831+
practical terms, this means the following:
832+
833+
- If an incoming HTTP or WebSocket request includes the ``Origin`` header,
834+
this header must match the scheme and host of the connection URL. In case
835+
of a mismatch, a 400 status code response is returned and the connection is
836+
rejected.
837+
- No restrictions are imposed on incoming requests that do not include the
838+
``Origin`` header.
839+
840+
If necessary, the ``cors_allowed_origins`` option can be used to allow other
841+
origins. This argument can be set to a string to set a single allowed origin, or
842+
to a list to allow multiple origins. A special value of ``'*'`` can be used to
843+
instruct the server to allow all origins, but this should be done with care, as
844+
this could make the server vulnerable to Cross-Site Request Forgery (CSRF)
845+
attacks.

setup.py

Lines changed: 1 addition & 1 deletion
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.8.0,<3.9.0'
33+
'python-engineio>=3.9.0'
3434
],
3535
extras_require={
3636
'client': [

0 commit comments

Comments
 (0)