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. |
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
6596
96
67