diff options
author | Michael Krotscheck <krotscheck@gmail.com> | 2015-08-05 16:03:28 -0700 |
---|---|---|
committer | Michael Krotscheck <krotscheck@gmail.com> | 2015-08-12 09:57:54 -0700 |
commit | 3fbb59574ca3bceb42baa0847d146f471145ab31 (patch) | |
tree | 0563848b83eac29522a1ca1c11ebae8d95a9af59 /doc | |
parent | 3b3b30b1dabe96d89e19421158d3330399958649 (diff) | |
download | oslo-middleware-3fbb59574ca3bceb42baa0847d146f471145ab31.tar.gz |
Added latent properties to CORS middleware.
Latent properties allow a consumer of this middleware to declare
system-required headers and methods options. For instance, if an
API exposes version-negotiation headers, these may be hard coded
when the middleware is attached.
This only works when the middleware is explicitly used. It does
not work in paste configuration.
Change-Id: Ic55b1af23603a0d83a32d20054c18e50367be8fb
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/cors.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/source/cors.rst b/doc/source/cors.rst index 5763099..09f5d77 100644 --- a/doc/source/cors.rst +++ b/doc/source/cors.rst @@ -78,6 +78,17 @@ legibility, we recommend using a reasonable human-readable string:: allowed_origin=* allow_methods=GET +If your software requires specific headers or methods for proper operation, you +may include these as latent properties. These will be evaluated in addition +to any found in configuration:: + + from oslo_middleware import cors + + app = cors.CORS(your_wsgi_application) + app.set_latent(allow_headers=['X-System-Header'], + expose_headers=['X-System-Header'], + allow_methods=['GET','PATCH']) + Configuration for pastedeploy ----------------------------- |