From f517bfccd8987cc3fc29131cdc8fa7288e2b3d4c Mon Sep 17 00:00:00 2001 From: Vivek Thuravupala Date: Thu, 9 Oct 2025 18:54:51 -0700 Subject: [PATCH] Reconcile secureReadFile changes with reverted mock response extractor changes --- .../src/ui/components/editors/mock-response-extractor.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx b/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx index 90648e3078..ede05bb51b 100644 --- a/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx +++ b/packages/insomnia/src/ui/components/editors/mock-response-extractor.tsx @@ -140,7 +140,7 @@ If you want to create a self-hosted mock server route from a request response in label: 'Name', onComplete: async name => { invariant(activeResponse, 'Active response must be defined'); - const body = 'bodyPath' in activeResponse ? await fs.readFile(activeResponse.bodyPath) : ''; + const body = 'bodyPath' in activeResponse ? await window.main.secureReadFile({ path: activeResponse.bodyPath }) : ''; // auth mechanism is too sensitive to allow content length checks const headersWithoutContentLength: ResponseHeader[] = activeResponse.headers.filter( h => h.name.toLowerCase() !== 'content-length', @@ -171,7 +171,7 @@ If you want to create a self-hosted mock server route from a request response in label: 'Name', onComplete: async name => { invariant(activeResponse, 'Active response must be defined'); - const body = 'bodyPath' in activeResponse ? await fs.readFile(activeResponse.bodyPath) : ''; + const body = 'bodyPath' in activeResponse ? await window.main.secureReadFile({ path: activeResponse.bodyPath }) : ''; const hasRouteInServer = mockServerAndRoutes .find(s => s._id === selectedMockServer) ?.routes.find(r => r.name === name && r.method.toUpperCase() === 'GET');