From f178674d7f92e1b3306a5268843c32fcd107ab8f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 9 Sep 2019 08:21:51 +0200 Subject: [PATCH] No wss warn on 127.0.0.1 (#1597) --- packages/apps/src/overlays/Connecting.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/apps/src/overlays/Connecting.tsx b/packages/apps/src/overlays/Connecting.tsx index f6a05a5a75..bf27e04846 100644 --- a/packages/apps/src/overlays/Connecting.tsx +++ b/packages/apps/src/overlays/Connecting.tsx @@ -16,7 +16,7 @@ import BaseOverlay from './Base'; const isFirefox = typeof (window as any).InstallTrigger !== 'undefined'; const wsUrl = settings.apiUrl; const isWs = wsUrl.startsWith('ws://'); -const isWsRemote = wsUrl.includes('127.0.0.1'); +const isWsLocal = wsUrl.includes('127.0.0.1'); const isHttps = window.location.protocol.startsWith('https:'); function ExtensionOverlay ({ className, isWaitingInjected, t }: ApiProps & Props): React.ReactElement | null { @@ -51,7 +51,7 @@ function ConnectOverlay ({ className, isApiConnected, t }: ApiProps & Props): Re : undefined } { - isWs && isWsRemote && isHttps + isWs && !isWsLocal && isHttps ?
{t('You are connecting from a secure location to an insecure WebSocket ({{wsUrl}}). Due to browser mixed-content security policies this connection type is not allowed. Change the RPC service to a secure \'wss\' endpoint.', { replace: { wsUrl } })}
: undefined }