Comparing version 4.1.2 to 4.2.0
16
index.js
@@ -13,7 +13,7 @@ import kcors from '@koa/cors' | ||
name: 'cors.origin', | ||
description: '`Access-Control-Allow-Origin` value. Default is the request Origin header.' | ||
description: 'Set a `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: 'Set a `Access-Control-Allow-Methods` value. Default is "GET,HEAD,PUT,POST,DELETE,PATCH"' | ||
}, | ||
@@ -23,11 +23,16 @@ { | ||
type: Boolean, | ||
description: 'Adds `Access-Control-Allow-Credentials` header.' | ||
description: 'Set this flag to add `Access-Control-Allow-Credentials` header.' | ||
}, | ||
{ | ||
name: 'cors.opener-policy', | ||
description: 'A value for the `Cross-Origin-Opener-Policy` header (specify `unsafe-none`, same-origin-allow-popups` or `same-origin`).' | ||
description: 'Set a value for the `Cross-Origin-Opener-Policy` header (specify `unsafe-none`, same-origin-allow-popups` or `same-origin`).' | ||
}, | ||
{ | ||
name: 'cors.embedder-policy', | ||
description: 'A value for the `Cross-Origin-Embedder-Policy` header (specify `unsafe-none` or `require-corp`).' | ||
description: 'Set a value for the `Cross-Origin-Embedder-Policy` header (specify `unsafe-none` or `require-corp`).' | ||
}, | ||
{ | ||
name: 'cors.private-network-access', | ||
type: Boolean, | ||
description: 'Set this flag to enable `Access-Control-Request-Private-Network` support.' | ||
} | ||
@@ -42,2 +47,3 @@ ] | ||
if (config.corsCredentials) corsOptions.credentials = config.corsCredentials | ||
if (config.corsPrivateNetworkAccess) corsOptions.privateNetworkAccess = config.corsPrivateNetworkAccess | ||
@@ -44,0 +50,0 @@ this.emit('verbose', 'middleware.cors.config', { |
{ | ||
"name": "lws-cors", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "4.1.2", | ||
"version": "4.2.0", | ||
"description": "Support for setting Cross-Origin Resource Sharing (CORS) headers to lws", | ||
"repository": "https://github.com/lwsjs/cors.git", | ||
"repository": "https://github.com/lwsjs/cors", | ||
"license": "MIT", | ||
@@ -22,7 +22,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@koa/cors": "^3.2.0" | ||
"@koa/cors": "^3.4.3" | ||
}, | ||
"devDependencies": { | ||
"lws": "^4.1.1", | ||
"node-fetch": "^3.2.3", | ||
"lws": "^4.1.2", | ||
"node-fetch": "^3.3.0", | ||
"test-runner": "^0.10.1" | ||
@@ -29,0 +29,0 @@ }, |
@@ -10,3 +10,3 @@ [![view on npm](https://badgen.net/npm/v/lws-cors)](https://www.npmjs.org/package/lws-cors) | ||
Support for setting Cross-Origin Resource Sharing (CORS) headers to lws. For usage instructions, see [here](https://github.com/lwsjs/local-web-server/wiki/How-to-configure-Cross-Origin-Resource-Sharing-(CORS)). | ||
Support for setting Cross-Origin Resource Sharing (CORS) headers to lws. Wraps [@koajs/cors](https://github.com/koajs/cors). For usage instructions, see [here](https://github.com/lwsjs/local-web-server/wiki/How-to-configure-Cross-Origin-Resource-Sharing-(CORS)). | ||
@@ -16,10 +16,12 @@ Adds the following options to lws. | ||
``` | ||
--cors.origin `Access-Control-Allow-Origin` value. Default is the request Origin header. | ||
--cors.allow-methods `Access-Control-Allow-Methods` value. Default is | ||
"GET,HEAD,PUT,POST,DELETE,PATCH" | ||
--cors.credentials Adds `Access-Control-Allow-Credentials` header. | ||
--cors.opener-policy string A value for the `Cross-Origin-Opener-Policy` header (specify `unsafe-none`, | ||
same-origin-allow-popups` or `same-origin`). | ||
--cors.embedder-policy string A value for the `Cross-Origin-Embedder-Policy` header (specify `unsafe-none` | ||
or `require-corp`). | ||
--cors.origin string Set a `Access-Control-Allow-Origin` value. Default is the request Origin | ||
header. | ||
--cors.allow-methods string Set a `Access-Control-Allow-Methods` value. Default is | ||
"GET,HEAD,PUT,POST,DELETE,PATCH" | ||
--cors.credentials Set this flag to add `Access-Control-Allow-Credentials` header. | ||
--cors.opener-policy string Set a value for the `Cross-Origin-Opener-Policy` header (specify `unsafe- | ||
none`, same-origin-allow-popups` or `same-origin`). | ||
--cors.embedder-policy string Set a value for the `Cross-Origin-Embedder-Policy` header (specify `unsafe- | ||
none` or `require-corp`). | ||
--cors.private-network-access Set this flag to enable `Access-Control-Request-Private-Network` support. | ||
``` | ||
@@ -29,2 +31,2 @@ | ||
© 2016-22 Lloyd Brookes \<75pound@gmail.com\>. | ||
© 2016-23 Lloyd Brookes \<75pound@gmail.com\>. |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
6059
60
30
Updated@koa/cors@^3.4.3