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

lws-cors

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lws-cors - npm Package Compare versions

Comparing version 0.3.5 to 1.0.0

12

index.js

@@ -9,8 +9,13 @@ module.exports = MiddlewareBase => class Cors extends MiddlewareBase {

name: 'cors.origin',
description: 'Access-Control-Allow-Origin value. Default is the request Origin header.'
description: '`Access-Control-Allow-Origin` value. Default is the request Origin header.'
},
{
name: 'cors.allow-methods',
description: 'Access-Control-Allow-Methods value. Default is "GET,HEAD,PUT,POST,DELETE,PATCH"'
description: '`Access-Control-Allow-Methods` value. Default is "GET,HEAD,PUT,POST,DELETE,PATCH"'
},
{
name: 'cors.credentials',
type: Boolean,
description: 'Adds `Access-Control-Allow-Credentials` header.'
}
]

@@ -23,6 +28,7 @@ }

if (options.corsAllowMethods) corsOptions.allowMethods = options.corsAllowMethods
if (options.corsCredentials) corsOptions.credentials = options.corsCredentials
this.emit('verbose', 'middleware.cors.config', corsOptions)
const kcors = require('kcors')
const kcors = require('@koa/cors')
return kcors(corsOptions)
}
}
{
"name": "lws-cors",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "0.3.5",
"version": "1.0.0",
"description": "Support for setting Cross-Origin Resource Sharing (CORS) headers to lws",

@@ -19,6 +19,6 @@ "repository": "https://github.com/lwsjs/cors.git",

"dependencies": {
"kcors": "^2.2.1"
"@koa/cors": "^2.2.1"
},
"devDependencies": {
"lws": "^1.0.0-pre4.0",
"lws": "^1.1.4",
"req-then": "^0.6.4",

@@ -25,0 +25,0 @@ "test-runner": "^0.4.0"

@@ -5,2 +5,4 @@ const TestRunner = require('test-runner')

const request = require('req-then')
const usage = require('lws/lib/usage')
usage.disable()

@@ -7,0 +9,0 @@ const runner = new TestRunner()

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