Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

roughrider.cors

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roughrider.cors

CORS Policy for Web applications

  • 0.1
  • PyPI
  • Socket score

Maintainers
1

roughrider.cors


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.

Example

.. code-block:: python

from roughrider.cors.policy import CORSPolicy

cors = CORSPolicy( methods=['GET', 'POST'], allow_headers=['Accept-Encoding'], expose_headers=['Accept-Encoding'], max_age=19000 )

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( origin='http://example.com', acr_headers='X-Custom-Header, Accept-Encoding' ))

CHANGES

0.1 (2021-10-09)

  • Initial release.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc