diff --git a/src/index.ts b/src/index.ts index bc01b1f1..079b64e5 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" });