From 70ce01c604de4dfe7fd976b0106130da0535e9a3 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Sat, 26 Oct 2019 01:09:03 +1100 Subject: [PATCH] Use wss if origin uses https (#161) --- ui/v2/src/core/StashService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/v2/src/core/StashService.ts b/ui/v2/src/core/StashService.ts index 2595d62cc..d7c2796e0 100644 --- a/ui/v2/src/core/StashService.ts +++ b/ui/v2/src/core/StashService.ts @@ -23,9 +23,12 @@ export class StashService { if (process.env.REACT_APP_HTTPS === "true") { platformUrl.protocol = "https:"; - wsPlatformUrl.protocol = "wss:"; } } + + if (platformUrl.protocol === "https:") { + wsPlatformUrl.protocol = "wss:"; + } const url = platformUrl.toString().slice(0, -1) + "/graphql"; const wsUrl = wsPlatformUrl.toString().slice(0, -1) + "/graphql";