restify-cors-middleware
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5122
34
0