Skip to content

Commit 6848bed

Browse files
update CORS documentation (Fixes miguelgrinberg#327)
1 parent 659a51e commit 6848bed

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

socketio/asyncio_server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ class AsyncServer(server.Server):
5151
is greater than this value.
5252
:param cookie: Name of the HTTP cookie that contains the client session
5353
id. If set to ``None``, a cookie is not sent to the client.
54-
:param cors_allowed_origins: List of origins that are allowed to connect
55-
to this server. All origins are allowed by
56-
default.
54+
:param cors_allowed_origins: Origin or list of origins that are allowed to
55+
connect to this server. Only the same origin
56+
is allowed by default. Set this argument to
57+
``'*'`` to allow all origins, or to ``[]`` to
58+
disable CORS handling.
5759
:param cors_credentials: Whether credentials (cookies, authentication) are
5860
allowed in requests to this server.
5961
:param engineio_logger: To enable Engine.IO logging set to ``True`` or pass

socketio/server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ class Server(object):
7878
:param cookie: Name of the HTTP cookie that contains the client session
7979
id. If set to ``None``, a cookie is not sent to the client.
8080
The default is ``'io'``.
81-
:param cors_allowed_origins: List of origins that are allowed to connect
82-
to this server. All origins are allowed by
83-
default.
81+
:param cors_allowed_origins: Origin or list of origins that are allowed to
82+
connect to this server. Only the same origin
83+
is allowed by default. Set this argument to
84+
``'*'`` to allow all origins, or to ``[]`` to
85+
disable CORS handling.
8486
:param cors_credentials: Whether credentials (cookies, authentication) are
8587
allowed in requests to this server. The default is
8688
``True``.

0 commit comments

Comments
 (0)