From a463d268ed90064e7863679bda423951de108c36 Mon Sep 17 00:00:00 2001 From: Jeffrey van Norden Date: Thu, 17 Feb 2022 06:36:49 +0100 Subject: [PATCH] fix(typings): allow CorsOptionsDelegate as cors options (#641) Reference: https://www.npmjs.com/package/cors#configuring-cors-asynchronously Related: https://github.com/DefinitelyTyped/DefinitelyTyped/commit/54a59cd8f0bdbee257ada2716fdc1b7c94909c40 --- lib/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server.ts b/lib/server.ts index 44ce2ee6..739e38aa 100644 --- a/lib/server.ts +++ b/lib/server.ts @@ -9,7 +9,7 @@ import { serialize } from "cookie"; import { Server as DEFAULT_WS_ENGINE } from "ws"; import { IncomingMessage, Server as HttpServer } from "http"; import { CookieSerializeOptions } from "cookie"; -import { CorsOptions } from "cors"; +import { CorsOptions, CorsOptionsDelegate } from "cors"; const debug = debugModule("engine"); @@ -105,7 +105,7 @@ export interface ServerOptions { /** * the options that will be forwarded to the cors module */ - cors?: CorsOptions; + cors?: CorsOptions | CorsOptionsDelegate; /** * whether to enable compatibility with Socket.IO v2 clients * @default false