From 31a948d4ea24f87b8d470e41aefdda84da267af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Dubigny?= Date: Mon, 21 Oct 2024 17:43:54 +0200 Subject: [PATCH] fix: undefined baseUrl makes the app crash --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index bc01b1f15..079b64e57 100644 --- a/src/index.ts +++ b/src/index.ts @@ -110,7 +110,7 @@ if (FEATURE_USE_SECURITY_RESPONSE_HEADERS) { app.set("etag", false); let morganOption: morgan.Options = { - skip: (req: Request, _res: Response) => req.baseUrl.startsWith("/dist"), + skip: (req: Request, _res: Response) => req.baseUrl?.startsWith("/dist"), }; if (ACCESS_LOG_PATH) { morganOption.stream = fs.createWriteStream(ACCESS_LOG_PATH, { flags: "a" });