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.3 to 0.0.4

2

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

@@ -5,0 +5,0 @@ "license": "MIT",

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

var cors = corsMiddleware({
preflightMaxAge: 5 //Optional
origins: ['http://api.myapp.com', 'http://web.myapp.com'],

@@ -13,0 +14,0 @@ allowHeaders: ['API-Token'],

@@ -45,2 +45,7 @@ var restify = require('restify');

// 6.2.8
if (options.preflightMaxAge) {
res.header('Access-Control-Max-Age', options.preflightMaxAge);
}
// 6.2.9

@@ -58,2 +63,1 @@ res.header('Access-Control-Allow-Methods', allowedMethods.join(', '));

};

@@ -87,4 +87,14 @@ //

xit('6.2.8 Access-Control-Max-Age not supported', function(done) {
done();
it('6.2.8 Set the Access-Control-Max-Age header if a max age is provided', function(done) {
var server = test.corsServer({
preflightMaxAge: 5,
origins: ['http://api.myapp.com', 'http://www.myapp.com']
});
request(server)
.options('/test')
.set('Origin', 'http://api.myapp.com')
.set('Access-Control-Request-Method', 'GET')
.expect('Access-Control-Max-Age', '5')
.expect(204)
.end(done);
});

@@ -91,0 +101,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