From 43435af89b1b833c19671402464704af7b3524b4 Mon Sep 17 00:00:00 2001 From: dongzp <975303544@qq.com> Date: Thu, 4 Jun 2026 15:45:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=AD=E6=96=87=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/proxy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proxy.ts b/src/proxy.ts index 90713dd..5eaa4fe 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -104,7 +104,7 @@ export function createProxyServer(): http.Server { clientRes.writeHead(mockStatusCode, { ...proxyRes.headers, "X-Mock-Autogenerated": "true", - "X-Mock-Source": mockFile, + "X-Mock-Source": encodeURIComponent(mockFile), "X-Mock-Status-Code": String(mockStatusCode), }); clientRes.end(bodyBuffer); @@ -140,7 +140,7 @@ export function createProxyServer(): http.Server { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS", "Access-Control-Allow-Headers": "Content-Type", - "X-Mock-Source": mockFile, + "X-Mock-Source": encodeURIComponent(mockFile), "X-Mock-Status-Code": String(mockStatusCode), "X-Mock-Timestamp": new Date().toISOString(), });