mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-22 01:08:37 +01:00
Merge pull request #1365 from turt2live/travis/cors
Document the CORS/preflight headers
This commit is contained in:
commit
c79010f0d6
|
|
@ -35,6 +35,8 @@ Unreleased changes
|
||||||
(`#1274 <https://github.com/matrix-org/matrix-doc/pull/1274>`_).
|
(`#1274 <https://github.com/matrix-org/matrix-doc/pull/1274>`_).
|
||||||
- Document the GET version of ``/login``
|
- Document the GET version of ``/login``
|
||||||
(`#1361 <https://github.com/matrix-org/matrix-doc/pull/1361>`_).
|
(`#1361 <https://github.com/matrix-org/matrix-doc/pull/1361>`_).
|
||||||
|
- Document the CORS/preflight headers
|
||||||
|
(`#1365 <https://github.com/matrix-org/matrix-doc/pull/1365>`_).
|
||||||
|
|
||||||
- Spec clarifications:
|
- Spec clarifications:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,25 @@ recommended.
|
||||||
|
|
||||||
{{versions_cs_http_api}}
|
{{versions_cs_http_api}}
|
||||||
|
|
||||||
|
Web Browser Clients
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
It is realistic to expect that some clients will be written to be run within a
|
||||||
|
web browser or similar environment. In these cases, the homeserver should respond
|
||||||
|
to pre-flight requests and supply Cross-Origin Resource Sharing (CORS) headers on
|
||||||
|
all requests.
|
||||||
|
|
||||||
|
When a client approaches the server with a pre-flight (``OPTIONS``) request, the
|
||||||
|
server should respond with the CORS headers for that route. The recommended CORS
|
||||||
|
headers to be returned by servers on all requests are:
|
||||||
|
|
||||||
|
.. code::
|
||||||
|
|
||||||
|
Access-Control-Allow-Origin: *
|
||||||
|
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
|
||||||
|
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
|
||||||
|
|
||||||
|
|
||||||
Client Authentication
|
Client Authentication
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue