From 087dd2c26247b33a88f313e0116d0d654ed16cfa Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 9 Jun 2024 13:37:35 +0200 Subject: [PATCH] fix proxy --- apps/remix-ide/src/app/files/dgitProvider.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide/src/app/files/dgitProvider.ts b/apps/remix-ide/src/app/files/dgitProvider.ts index 1944dba810..09c6b8ac0d 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.ts +++ b/apps/remix-ide/src/app/files/dgitProvider.ts @@ -91,7 +91,7 @@ class DGitProvider extends Plugin { const token = await this.call('config' as any, 'getAppParameter', 'settings/gist-access-token') let config = { - corsProxy: null, + corsProxy: 'https://corsproxy.remixproject.org/', http, onAuth: url => { url @@ -105,20 +105,20 @@ class DGitProvider extends Plugin { if(input.url) { const url = new URL(input.url) - if (url.hostname.includes('github.com')) { + if (url.hostname.includes('localhost')) { config = { ...config, - corsProxy: 'https://corsproxy.remixproject.org/', + corsProxy: null } } } if((input.remote && input.remote.url)) { const url = new URL(input.remote.url) - if (url.hostname.includes('github.com')) { + if (url.hostname.includes('localhost')) { config = { ...config, - corsProxy: 'https://corsproxy.remixproject.org/', + corsProxy: null, } } } @@ -130,6 +130,13 @@ class DGitProvider extends Plugin { } } + if(input.provider && input.provider === 'localhost') { + config = { + ...config, + corsProxy: null + } + } + return config }