Updated CORS documentation for oslo_middleware v3.0.0
This patch adjusts language in the CORS documentation to be less proscriptive about the preferred configuration method (paste vs. oslo). Furthermore, it updates the code samples to demonstrate new configuration features available in 3.0.0. Change-Id: Iabb902ffb01d9713f437b7efc777ce6b6a565486
This commit is contained in:
parent
1a7bfc93e4
commit
17db1181e7
@ -45,7 +45,7 @@ configuration file, or add it yourself according to the pattern below.
|
|||||||
allow_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma,X-Custom-Header
|
allow_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma,X-Custom-Header
|
||||||
expose_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma,X-Custom-Header
|
expose_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma,X-Custom-Header
|
||||||
|
|
||||||
This method also enables you to define multiple origins. To express this in
|
Additional origins can be explicitly added. To express this in
|
||||||
your configuration file, first begin with a ``[cors]`` group as above,
|
your configuration file, first begin with a ``[cors]`` group as above,
|
||||||
into which you place your default configuration values. Then, add as many
|
into which you place your default configuration values. Then, add as many
|
||||||
additional configuration groups as necessary, naming them
|
additional configuration groups as necessary, naming them
|
||||||
@ -74,11 +74,10 @@ human-readable string:
|
|||||||
Enabling CORS with PasteDeploy
|
Enabling CORS with PasteDeploy
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
In other services, CORS is configured via PasteDeploy. In this case,
|
CORS can also be configured using PasteDeploy. First of all, ensure that
|
||||||
you must first make sure that OpenStack's ``oslo_middleware`` package
|
OpenStack's ``oslo_middleware`` package (version 2.4.0 or later) is
|
||||||
(version 2.4.0 or later) is available in the Python environment that is
|
available in the Python environment that is running the service. Then,
|
||||||
running the service. Then, add the following configuration block to your
|
add the following configuration block to your ``paste.ini`` file.
|
||||||
``paste.ini`` file.
|
|
||||||
|
|
||||||
.. code-block:: ini
|
.. code-block:: ini
|
||||||
|
|
||||||
@ -91,8 +90,9 @@ running the service. Then, add the following configuration block to your
|
|||||||
expose_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma,X-Custom-Header
|
expose_headers = Content-Type,Cache-Control,Content-Language,Expires,Last-Modified,Pragma,X-Custom-Header
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
To add an additional domain in oslo_middleware v2.4.0, add
|
||||||
To add another domain, simply add another filter.
|
another filter. In v3.0.0 and after, you may add multiple domains
|
||||||
|
in the above ``allowed_origin`` field, separated by commas.
|
||||||
|
|
||||||
Security concerns
|
Security concerns
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
Loading…
Reference in New Issue
Block a user