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

permissive-cors

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

permissive-cors

CORS for Node HTTP in the most permissive way

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Permissive CORS

Build Status

Allows CORS for Node HTTP in the most permissive way.

Any specific headers or HTTP verbs requested by client calls via Access-Control-Request-Method or Access-Control-Request-Headers will be automatically added to the corresponding response headers. In other words, this middleware ALLOWS ALL THE THINGS.

Installation

npm install permissive-cors

Example

Example using Express:

var express = require('express');
var app = express();

var cors = require('permissive-cors');
app.use(cors());

app.put('/', function (req, res) {
  //...
});
app.delete('/', function (req, res) {
  //...
});

Example using Node HTTP:

var http = request('http');
var cors = require('permissive-cors');
var corsMiddleware = cors();

http.createServer(function (req, res) {
  corsMiddleware(req, res, function onDone() {
    // your code here
    res.end();
  });
});

Tests

Run npm test

Compatibility

Tested in Chrome 36, Safari 7 and Firefox 30. For any bugs found, feel free to submit a PR.

Keywords

FAQs

Package last updated on 30 Nov 2015

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