Skip to content

Commit

Permalink
fix: cors
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed Feb 14, 2022
1 parent 764859d commit f9ba21f
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 181 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"license": "MIT",
"private": true,
"devDependencies": {
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.17",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"@types/node": "^17.0.18",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"cross-env": "^7.0.3",
"eslint": "^8.8.0",
"eslint": "^8.9.0",
"eslint-plugin-unused-imports": "^2.0.0",
"jest": "^27.5.1",
"rimraf": "^3.0.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/web/src/Transport/Validation/CorsValidation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Application, IRoute, IRouteMatcher, RegexpMatcher, RequestValidatorAbstract, RouteNotFound} from "@bunt/app";
import {ActionAny} from "@bunt/unit";
import {assert, isDefined, isFunction, isString} from "@bunt/util";
import {assert, isFunction, isString} from "@bunt/util";
import {Headers} from "../Headers";
import {ICorsOptions} from "../interfaces";
import {Responder} from "../Responder";
Expand Down Expand Up @@ -71,8 +71,8 @@ export class CorsValidation extends RequestValidatorAbstract<ICorsOptions> {
headers.push(["Vary", vary]);
}

if (isDefined(this.options.credentials)) {
headers.push(["access-control-allow-credentials", this.options.credentials ? "true" : "false"]);
if (this.options.credentials) {
headers.push(["access-control-allow-credentials", "true"]);
}

return headers;
Expand Down
Loading

0 comments on commit f9ba21f

Please sign in to comment.