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 1.0.0 to 2.0.0

17

index.js

@@ -1,5 +0,8 @@

module.exports = MiddlewareBase => class Cors extends MiddlewareBase {
const EventEmitter = require('events')
class Cors extends EventEmitter {
description () {
return 'Support for setting Cross-Origin Resource Sharing (CORS) headers.'
}
optionDefinitions () {

@@ -22,8 +25,8 @@ return [

}
middleware (options) {
options = options || {}
middleware (config) {
const corsOptions = {}
if (options.corsOrigin) corsOptions.origin = options.corsOrigin
if (options.corsAllowMethods) corsOptions.allowMethods = options.corsAllowMethods
if (options.corsCredentials) corsOptions.credentials = options.corsCredentials
if (config.corsOrigin) corsOptions.origin = config.corsOrigin
if (config.corsAllowMethods) corsOptions.allowMethods = config.corsAllowMethods
if (config.corsCredentials) corsOptions.credentials = config.corsCredentials
this.emit('verbose', 'middleware.cors.config', corsOptions)

@@ -34,1 +37,3 @@ const kcors = require('@koa/cors')

}
module.exports = Cors
{
"name": "lws-cors",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "1.0.0",
"version": "2.0.0",
"description": "Support for setting Cross-Origin Resource Sharing (CORS) headers to lws",

@@ -13,3 +13,3 @@ "repository": "https://github.com/lwsjs/cors.git",

"engines": {
"node": ">=7.6"
"node": ">=8"
},

@@ -20,9 +20,12 @@ "scripts": {

"dependencies": {
"@koa/cors": "^2.2.1"
"@koa/cors": "^3.0.0"
},
"devDependencies": {
"lws": "^1.1.4",
"req-then": "^0.6.4",
"test-runner": "^0.4.0"
}
"lws": "^2.0.0-7",
"node-fetch": "^2.6.0",
"test-runner": "^0.6.0"
},
"files": [
"index.js"
]
}
[![view on npm](https://img.shields.io/npm/v/lws-cors.svg)](https://www.npmjs.org/package/lws-cors)
[![npm module downloads](https://img.shields.io/npm/dt/lws-cors.svg)](https://www.npmjs.org/package/lws-cors)
[![Build Status](https://travis-ci.org/lwsjs/cors.svg?branch=master)](https://travis-ci.org/lwsjs/cors)
[![Dependency Status](https://david-dm.org/lwsjs/cors.svg)](https://david-dm.org/lwsjs/cors)
[![Dependency Status](https://badgen.net/david/dep/lwsjs/cors)](https://david-dm.org/lwsjs/cors)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)

@@ -13,2 +13,2 @@

&copy; 2017 Lloyd Brookes <75pound@gmail.com>.
&copy; 2016-19 Lloyd Brookes \<75pound@gmail.com\>.

Sorry, the diff of this file is not supported yet

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