Skip to main content

CORS Policy for Web applications

Project description

This package allows you to create a policy that can handle CORS. It can be used with any python framework as it’s totally agnostic. It can cook response headers, even for preflight requests.


from roughrider.cors.policy import CORSPolicy

cors = CORSPolicy(
    methods=['GET', 'POST'],

headers = list(cors.headers())

# Arguments for the preflight should be extracted from the request.
# depending on the type of framework you use (WSGI, ASGI...)
preflight_headers = list(cors.preflight(
    acr_headers='X-Custom-Header, Accept-Encoding'


0.1 (2021-10-09)

  • Initial release.

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Source Distribution

roughrider.cors-0.1.tar.gz (5.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page