awesome-repositories.com
Blog
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
adamchainz avatar

adamchainz/django-cors-headers

0
View on GitHub↗
5,587 stars·551 forks·Python·MIT·5 views

Django Cors Headers

django-cors-headers is a middleware for Django that manages Cross-Origin Resource Sharing headers to control which external domains can access server resources. It serves as a security component for enforcing access control policies through origin validation and header management.

The project provides capabilities for origin whitelisting using hostnames or regular expressions and supports the Local Network Access specification to permit requests from private networks. It allows for granular control via path-based restrictions and dynamic origin validation driven by a signal system.

The software covers broader security and performance areas including credential management, request filtering, and response header exposure control. It also manages cache coordination by adding the origin to the vary header to prevent content collisions between different cross-origin requests.

Features

  • Cross-Origin Resource Sharing (CORS) Policies - Provides mechanisms to restrict or allow web requests from different origins using CORS headers in Django.
  • Origin Pattern Matching - Validates request origins against a whitelist using hostnames and regular expressions.
  • Cross-Origin Networking - Manages resource fetching and API interactions across different origins to restrict third-party access.
  • CORS Header Injection - Implements the automatic injection of CORS headers into HTTP responses via Django middleware.
  • CORS Header Management - Provides tools for defining allowed origins, methods, and headers for incoming requests based on the CORS protocol.
  • Domain Whitelists - Validates incoming request origins against a predefined whitelist of allowed hostnames or regular expressions.
  • API Security - Protects APIs from unauthorized cross-site access by controlling request credentials and allowed headers.
  • CORS Middleware - Implements middleware for Django that manages Cross-Origin Resource Sharing policies via HTTP headers.
  • Credentialed Cross-Origin Requests - Configures CORS policies to permit the transmission of cookies and authentication credentials in cross-origin requests.
  • Path-Based Restrictions - Allows for granular CORS policy enforcement by restricting permissions to specific request paths or URL patterns.
  • Dynamic - Implements a signal-based system to evaluate request origins using runtime logic or database lookups.
  • Local Network Access Support - Implements headers required by the Local Network Access specification to permit requests from private networks.
  • Local Network Access - Provides the required headers to comply with the Local Network Access specification for private network requests.
  • URL Path Restrictions - Allows applying specific CORS policies to individual URL patterns rather than a global configuration.
  • Authorization Signals - Provides a signal system to determine origin permissions at runtime based on external data.
  • CORS Header Exposure - Controls which response headers are visible to client-side scripts using the Access-Control-Expose-Headers header.
  • Route-Based CORS Filtering - Filters cross-origin resource sharing restrictions based on specific URL patterns.
  • API Development - Handle Cross-Origin Resource Sharing for decoupled frontends.

Star history

Star history chart for adamchainz/django-cors-headersStar history chart for adamchainz/django-cors-headers

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Django Cors Headers

Similar open-source projects, ranked by how many features they share with Django Cors Headers.
  • ottoyiu/django-cors-headersottoyiu avatar

    ottoyiu/django-cors-headers

    5,587View on GitHub↗

    django-cors-headers is a Django application utility for managing cross-origin resource sharing. It adds HTTP headers to responses so web browsers can permit cross-origin requests from specified external domains. The project provides tools for defining which external domains, HTTP methods, and headers are permitted to access an API. It supports restricting allowed origins through static lists and regular expressions, and it enables the transmission of cookies and authentication credentials for cross-site session handling. Additional capabilities include API access control to limit cross-origi

    Python
    View on GitHub↗5,587
  • expressjs/corsexpressjs avatar

    expressjs/cors

    6,194View on GitHub↗

    This is a Node.js middleware for Express and Node.js servers that manages Cross-Origin Resource Sharing policies. It functions as a policy manager and origin validator to define which origins, HTTP methods, and headers are permitted to access server resources. The project provides mechanisms for dynamic origin validation, allowing request origins to be checked against custom logic or databases. It also acts as an HTTP preflight request handler to process OPTIONS requests and verify server permissions before complex cross-site interactions occur. Its capability surface covers the management o

    JavaScriptcorsexpressjsjavascript
    View on GitHub↗6,194
  • fruitcake/laravel-corsfruitcake avatar

    fruitcake/laravel-cors

    6,240View on GitHub↗

    This project is a CORS header manager and security plugin for Laravel. It functions as middleware that adds Cross-Origin Resource Sharing headers to HTTP responses to control how external domains access a Laravel backend. The software manages cross-origin request policies by defining allowed origins, methods, and headers. It handles pre-flight requests and allows for the restriction of sharing policies based on specific routes. The package provides API access control and cross-domain resource sharing by integrating custom header logic into the Laravel request lifecycle.

    PHPcorshacktoberfestlaravel
    View on GitHub↗6,240
  • barryvdh/laravel-corsbarryvdh avatar

    barryvdh/laravel-cors

    6,240View on GitHub↗

    laravel-cors is a middleware package for Laravel applications that manages Cross-Origin Resource Sharing. It functions as an HTTP security layer that validates request origins and injects the necessary headers into application responses to control how external domains access a backend API. The project provides a configuration-driven policy engine to match incoming request origins and methods against allowed values. This includes support for wildcard origin matching to authorize multiple trusted domains through a single rule and the automatic handling of pre-flight OPTIONS requests. The syste

    PHP
    View on GitHub↗6,240
See all 30 alternatives to Django Cors Headers→

Frequently asked questions

What does adamchainz/django-cors-headers do?

django-cors-headers is a middleware for Django that manages Cross-Origin Resource Sharing headers to control which external domains can access server resources. It serves as a security component for enforcing access control policies through origin validation and header management.

What are the main features of adamchainz/django-cors-headers?

The main features of adamchainz/django-cors-headers are: Cross-Origin Resource Sharing (CORS) Policies, Origin Pattern Matching, Cross-Origin Networking, CORS Header Injection, CORS Header Management, Domain Whitelists, API Security, CORS Middleware.

What are some open-source alternatives to adamchainz/django-cors-headers?

Open-source alternatives to adamchainz/django-cors-headers include: ottoyiu/django-cors-headers — django-cors-headers is a Django application utility for managing cross-origin resource sharing. It adds HTTP headers… expressjs/cors — This is a Node.js middleware for Express and Node.js servers that manages Cross-Origin Resource Sharing policies. It… fruitcake/laravel-cors — This project is a CORS header manager and security plugin for Laravel. It functions as middleware that adds… barryvdh/laravel-cors — laravel-cors is a middleware package for Laravel applications that manages Cross-Origin Resource Sharing. It functions… rob--w/cors-anywhere — This project is a Node.js HTTP proxy server that enables cross-domain API requests from browsers by injecting… javalin/javalin — Javalin is a lightweight web framework for Java and Kotlin designed for building REST APIs and web applications. It…