From a952594da003ec57ce4384429ed4c4530fc1395f Mon Sep 17 00:00:00 2001 From: Rahul Patni Date: Tue, 3 Sep 2024 14:22:53 -0700 Subject: [PATCH 1/2] Turns the upgrade-insecure-requests directive off in development mode When this is on, safari forces an https connection to the server. This is not ideal for development as it requires a valid SSL certificate. This is turned off in development mode. --- next.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index d27edd9a..6ff06a29 100644 --- a/next.config.js +++ b/next.config.js @@ -11,6 +11,8 @@ const nextConfig = { }, }, async headers() { + const isDev = process.env.NEXT_PUBLIC_ORIGIN !== 'https://ironfish.network/'; + return [ { source: "/:path*", @@ -31,7 +33,7 @@ object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; -upgrade-insecure-requests; +${isDev ? '' : 'upgrade-insecure-requests;'} `.replace(/\n/g, ""), }, ], From ac972f61a4d51fa3307547e330c733a77e0eb438 Mon Sep 17 00:00:00 2001 From: Rahul Patni Date: Mon, 14 Oct 2024 15:26:59 -0700 Subject: [PATCH 2/2] changing is dev evaluation to depend on node env --- next.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index 6ff06a29..7f5b3cf4 100644 --- a/next.config.js +++ b/next.config.js @@ -11,7 +11,7 @@ const nextConfig = { }, }, async headers() { - const isDev = process.env.NEXT_PUBLIC_ORIGIN !== 'https://ironfish.network/'; + const isDev = process.env.NODE_ENV === "development" return [ {