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

koa-cors

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-cors - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

17

index.js

@@ -26,9 +26,6 @@ /**

headers: settings.headers,
expose: settings.expose,
maxAge: settings.maxAge
};
if (typeof options === 'function') {
options = options(this.request);
}
if (typeof options.origin === 'function') {

@@ -78,2 +75,14 @@ options.origin = options.origin(this.request);

/**
* Access Control Expose Headers
*/
if (options.expose) {
if (options.expose.join) {
options.expose = options.expose.join(',');
}
if (options.expose.length) {
this.set('Access-Control-Expose-Headers', options.expose);
}
}
/**
* Access Control Allow Max Age

@@ -80,0 +89,0 @@ */

{
"name": "koa-cors",
"version": "0.0.7",
"version": "0.0.8",
"description": "CORS middleware for Koa",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -42,2 +42,5 @@ koa-cors

### expose
Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'WWW-Authenticate,Server-Authorization') or an array (ex: `['WWW-Authenticate', 'Server-Authorization]`). Set this to pass the header, otherwise it is omitted.
### credentials

@@ -44,0 +47,0 @@ Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted.

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