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

restify-cors-middleware

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restify-cors-middleware - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

12

package.json
{
"name": "restify-cors-middleware",
"version": "0.0.7",
"version": "0.0.8",
"author": "Tabcorp Digital Technology Team",

@@ -22,10 +22,10 @@ "license": "MIT",

"peerDependencies": {
"restify": "2.6.x - 4.1.x"
"restify": "2.6.x - 4.3.x"
},
"devDependencies": {
"mocha": "~1.18.2",
"should": "~3.3.1",
"restify": "~4.1.1",
"supertest": "~0.12.0"
"mocha": "~3.2.0",
"should": "~11.1.0",
"restify": "~4.3.0",
"supertest": "~2.0.0"
}
}

@@ -5,2 +5,11 @@ # restify-cors-middleware

[![NPM](http://img.shields.io/npm/v/restify-cors-middleware.svg?style=flat)](https://npmjs.org/package/restify-cors-middleware)
[![License](http://img.shields.io/npm/l/restify-cors-middleware.svg?style=flat)](https://github.com/TabDigital/restify-cors-middleware)
[![Build Status](http://img.shields.io/travis/TabDigital/restify-cors-middleware.svg?style=flat)](http://travis-ci.org/TabDigital/restify-cors-middleware)
[![Dependencies](http://img.shields.io/david/TabDigital/restify-cors-middleware.svg?style=flat)](https://david-dm.org/TabDigital/restify-cors-middleware)
[![Dev dependencies](http://img.shields.io/david/dev/TabDigital/restify-cors-middleware.svg?style=flat)](https://david-dm.org/TabDigital/restify-cors-middleware)
[![Peer dependencies](http://img.shields.io/david/peer/TabDigital/restify-cors-middleware.svg?style=flat)](https://david-dm.org/TabDigital/restify-cors-middleware)
[![Known Vulnerabilities](https://snyk.io/package/npm/restify-cors-middleware/badge.svg)](https://snyk.io/package/npm/restify-cors-middleware)
## Usage

@@ -7,0 +16,0 @@

@@ -24,15 +24,15 @@ var restify = require('restify');

// 6.2.1 and 6.2.2
originHeader = req.headers['origin'];
var originHeader = req.headers['origin'];
if (origin.match(originHeader, options.origins) === false) return next();
// 6.2.3
requestedMethod = req.headers['access-control-request-method'];
var requestedMethod = req.headers['access-control-request-method'];
if (!requestedMethod) return next();
// 6.2.4
requestedHeaders = req.headers['access-control-request-headers'];
var requestedHeaders = req.headers['access-control-request-headers'];
requestedHeaders = requestedHeaders ? requestedHeaders.split(', ') : [];
allowedMethods = [requestedMethod, 'OPTIONS'];
allowedHeaders = DEFAULT_ALLOW_HEADERS.concat(['x-requested-with'])
var allowedMethods = [requestedMethod, 'OPTIONS'];
var allowedHeaders = DEFAULT_ALLOW_HEADERS.concat(['x-requested-with'])
.concat(options.allowHeaders);

@@ -39,0 +39,0 @@

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