Comparing version 0.0.1 to 0.0.3
@@ -32,3 +32,5 @@ /** | ||
*/ | ||
if (options.origin === true) { | ||
if (options.origin === false) { | ||
return; | ||
} else if (options.origin === true) { | ||
options.origin = this.header.origin; | ||
@@ -80,2 +82,3 @@ } else if (!options.origin) { | ||
this.status = 204; | ||
return; | ||
} | ||
@@ -82,0 +85,0 @@ |
{ | ||
"name": "koa-cors", | ||
"version": "0.0.1", | ||
"version": "0.0.3", | ||
"description": "CORS middleware for koa", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,3 +34,3 @@ koa-cors | ||
### origin | ||
Configures the **Access-Control-Allow-Origin** CORS header. Expects a string (ex: "http://example.com"). Set to `true` to reflect the [request origin](http://tools.ietf.org/html/draft-abarth-origin-09), as defined by `req.header('Origin')`. Set to `false` to disable CORS. Can also be set to a function, which takes the request as the first parameter. | ||
Configures the **Access-Control-Allow-Origin** CORS header. Expects a string (ex: http://example.com). Set to `true` to reflect the [request origin](http://tools.ietf.org/html/draft-abarth-origin-09), as defined by `req.header('Origin')`. Set to `false` to disable CORS. Can also be set to a function, which takes the request as the first parameter. | ||
@@ -37,0 +37,0 @@ ### methods |
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
5920
82