From 6324cabb327eb8da748761e74be010349c8f61db Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sun, 28 Jun 2026 09:11:12 +0330 Subject: [PATCH] fix build --- menuPreviewProxy.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/menuPreviewProxy.ts b/menuPreviewProxy.ts index 08a8a65..a3a5ff4 100644 --- a/menuPreviewProxy.ts +++ b/menuPreviewProxy.ts @@ -1,5 +1,5 @@ import type { IncomingMessage, ServerResponse } from "node:http"; -import type { ClientRequest, IncomingMessage as ProxyIncomingMessage } from "node:http"; +import type { IncomingMessage as ProxyIncomingMessage } from "node:http"; import type { ProxyOptions } from "vite"; import { MENU_SITE_ORIGIN, isMenuSlugProxyPath, stripMenuPreviewCacheParam, toMenuSitePath } from "./src/config/menuPreview"; @@ -65,9 +65,9 @@ export const getMenuSiteTargetUrl = (url: string) => { return `${MENU_SITE_ORIGIN}${menuPath}${stripMenuPreviewCacheParam(search)}`; }; -export const createMenuSlugProxyAgent = () => ({ - configure: (proxy: { on: (event: string, handler: (...args: unknown[]) => void) => void }) => { - proxy.on("proxyReq", (proxyReq: ClientRequest) => { +export const createMenuSlugProxyAgent = (): { configure: NonNullable } => ({ + configure: (proxy) => { + proxy.on("proxyReq", (proxyReq) => { proxyReq.removeHeader("origin"); }); proxy.on("proxyRes", stripPreviewPageHeaders);