Skip to content

Commit

Permalink
Bump @koa/cors to v5
Browse files Browse the repository at this point in the history
- avoid a npm vulnerability using oidc-provider
  • Loading branch information
YannDanthu committed Jun 18, 2024
1 parent 523d587 commit 7fd6aa9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
8 changes: 7 additions & 1 deletion lib/shared/cors.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ function checkClientCORS(ctx, client) {
}

module.exports = ({ clientBased = false, ...options }) => {
const builtin = cors({ keepHeadersOnError: false, ...options });
const builtin = cors({
keepHeadersOnError: false,
origin(ctx) {
return ctx.get('Origin') || '*';
},
...options,
});

return async (ctx, next) => {
const headers = Object.keys(ctx.response.headers);
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"test": "node ./test/run"
},
"dependencies": {
"@koa/cors": "^3.3.0",
"@koa/cors": "^5.0.0",
"cacheable-lookup": "^6.0.4",
"debug": "^4.3.4",
"ejs": "^3.1.8",
"ejs": "^3.1.10",
"got": "^11.8.5",
"jose": "^4.10.3",
"jsesc": "^3.0.2",
Expand Down

0 comments on commit 7fd6aa9

Please sign in to comment.