Skip to content

Commit

Permalink
fix: case
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed Aug 15, 2020
1 parent 2f0511d commit 78ec159
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/web/src/Transport/Validation/CorsValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class CorsValidation extends RequestValidatorAbstract<ICorsOptions> {
}

const setHeaders: [string, string][] = [
["Access-Control-Allow-Origin", this.getAccessControlOrigin(request)],
["access-control-allow-origin", this.getAccessControlOrigin(request)],
];

const vary = this.getVary();
Expand All @@ -62,15 +62,15 @@ export class CorsValidation extends RequestValidatorAbstract<ICorsOptions> {

protected getAccessControlHeaders(request: Request, methods: string[]): [string, string][] {
const acRequestHeaders = request.headers.get(
"Access-Control-Request-Headers",
"Content-Type, Accept, Authorization",
"access-control-request-headers",
"content-type, accept, authorization",
);

const headers: [string, string][] = [
["Access-Control-Allow-Origin", this.getAccessControlOrigin(request)],
["Access-Control-Allow-Headers", acRequestHeaders],
["Access-Control-Allow-Methods", methods.join(", ")],
["Access-Control-Max-Age", "86400"],
["access-control-allow-origin", this.getAccessControlOrigin(request)],
["access-control-allow-headers", acRequestHeaders],
["access-control-allow-methods", methods.join(", ")],
["access-control-max-age", "86400"],
];

const vary = this.getVary();
Expand All @@ -79,7 +79,7 @@ export class CorsValidation extends RequestValidatorAbstract<ICorsOptions> {
}

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

return headers;
Expand Down

0 comments on commit 78ec159

Please sign in to comment.