Skip to content

Commit

Permalink
fix(@whook/cors): allow to configure all CORS headers
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Oct 1, 2020
1 parent c867e01 commit 8b933dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/whook-cors/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SwaggerParser from '@apidevtools/swagger-parser';
import { extractOperationSecurityParameters } from '@whook/http-router';
import initOptionsWithCORS from './handlers/optionsWithCORS';
import { reuseSpecialProps, alsoInject } from 'knifecycle';
import type { ServiceInitializer, Parameters, Dependencies } from 'knifecycle';
import type { ServiceInitializer, Parameters } from 'knifecycle';
import type { WhookResponse, WhookHandler, WhookOperation } from '@whook/whook';
import type { OpenAPIV3 } from 'openapi-types';

Expand All @@ -12,8 +12,11 @@ const METHOD_CORS_PRIORITY = ['head', 'get', 'post', 'put', 'delete', 'patch'];
export type CORSConfig = {
CORS: {
'Access-Control-Allow-Origin': string;
'Access-Control-Allow-Methods': string;
'Access-Control-Allow-Headers': string;
'Access-Control-Expose-Headers'?: string;
'Access-Control-Allow-Methods'?: string;
'Access-Control-Max-Age'?: string;
'Access-Control-Allow-Credentials'?: 'true';
Vary: string;
};
};
Expand Down

0 comments on commit 8b933dd

Please sign in to comment.