This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Falcon CORS middlware

Project Description
.. image:: https://travis-ci.org/lwcolton/falcon-cors.svg?branch=master
:target: https://travis-ci.org/lwcolton/falcon-cors

falcon-cors
========

About
------
This is a CORS algorithm and a falcon middleware for CORS.

Interface Documentation: https://falcon-cors.readthedocs.org/en/master/falcon_cors.html

pypi: https://pypi.python.org/pypi/falcon-cors

Install
-------

.. code-block:: shell

pip install falcon-cors

Usage
------
.. code-block:: python

import falcon
from falcon_cors import CORS

cors = CORS(allow_origins_list=['http://test.com:8080'])

api = falcon.API(middleware=[cors.middleware])


Override CORS for a specific resource
--------
.. code-block:: python

import falcon
from falcon_cors import CORS

cors = CORS(allow_origins_list=['http://test.com:8080'])

api = falcon.API(middleware=[cors.middleware])

public_cors = CORS(allow_all_origins=True)

class MyPublicResource:
cors = public_cors

def post(self, req, resp):
resp.body = "Everone can post to this resource"

api.add_route("/public", MyPublicResource())

Turn CORS off for a specific resource
--------
.. code-block:: python

class MyResource:
cors_enabled = False


Tests and Contributing
-------
If you want to contribute just submit a PR and please make sure you have created some tests for your feature.
Release History

Release History

This version
History Node

1.1.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
falcon-cors-1.1.2.tar.gz (6.3 kB) Copy SHA256 Checksum SHA256 Source Nov 12, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting