From 29532defee037497bf3ca7d8b671138f9e21425e Mon Sep 17 00:00:00 2001 From: Drew Davis Date: Wed, 7 Aug 2024 23:09:28 -0700 Subject: [PATCH] fix: align CorsOptions.origin type with @types/cors --- packages/vite/src/node/http.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/http.ts b/packages/vite/src/node/http.ts index 51a063ba800ccf..8a12179645fd23 100644 --- a/packages/vite/src/node/http.ts +++ b/packages/vite/src/node/http.ts @@ -75,7 +75,10 @@ export interface CommonServerOptions { export interface CorsOptions { origin?: | CorsOrigin - | ((origin: string, cb: (err: Error, origins: CorsOrigin) => void) => void) + | (( + origin: string | undefined, + cb: (err: Error, origins: CorsOrigin) => void, + ) => void) methods?: string | string[] allowedHeaders?: string | string[] exposedHeaders?: string | string[]