Skip to content

Commit

Permalink
build(deps): bump @koa/cors from 4.0.0 to 5.0.0 (#1240)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Dec 14, 2023
1 parent a450345 commit 9023e23
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 121 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) {
}

export default ({ 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
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"test": "node ./test/run"
},
"dependencies": {
"@koa/cors": "^4.0.0",
"@koa/cors": "^5.0.0",
"@koa/router": "^12.0.1",
"debug": "^4.3.4",
"eta": "^3.2.0",
Expand Down
Loading

0 comments on commit 9023e23

Please sign in to comment.