From 6a0732da5071fbb1a86392a1c5850d5f85e4be2d Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Mon, 15 Apr 2024 10:33:05 -0500 Subject: [PATCH 1/2] Fix Appzi feedback request by spoofing referer --- src/main/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/main.ts b/src/main/main.ts index 02e20b985..ee67d72ed 100755 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -271,7 +271,11 @@ function initialize() { // Avoid CORS (for all requests) for Dandiset creation win.webContents.session.webRequest.onBeforeSendHeaders( (details, callback) => { - callback({ requestHeaders: { Origin: '*', ...details.requestHeaders } }); + callback({ requestHeaders: { + Origin: '*', + Referer: "http://localhost:5174/", // Spoof the referrer + ...details.requestHeaders + } }); }, ); From 5dbbddddceb7a7043db58a274bc201e2530b3c9d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:34:56 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/main/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/main.ts b/src/main/main.ts index ee67d72ed..a434dcf13 100755 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -271,7 +271,7 @@ function initialize() { // Avoid CORS (for all requests) for Dandiset creation win.webContents.session.webRequest.onBeforeSendHeaders( (details, callback) => { - callback({ requestHeaders: { + callback({ requestHeaders: { Origin: '*', Referer: "http://localhost:5174/", // Spoof the referrer ...details.requestHeaders