From 899d7459c17bb74d8fe4e37bce136b1f92043cf3 Mon Sep 17 00:00:00 2001 From: artrejo Date: Fri, 21 Jan 2022 08:20:29 -0800 Subject: [PATCH] Fix Juno and Phoenix validations --- .vscode/launch.json | 6 ++++-- src/Juno/JunoClient.ts | 2 +- src/Phoenix/PhoenixClient.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 46e9150b3..bcb47a377 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,8 @@ "--inspect-brk", "${workspaceRoot}/node_modules/jest/bin/jest.js", "--runInBand", - "--coverage", "false" + "--coverage", + "false" ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", @@ -26,7 +27,8 @@ "--inspect-brk", "${workspaceRoot}/node_modules/jest/bin/jest.js", "${fileBasenameNoExtension}", - "--coverage", "false", + "--coverage", + "false", // "--watch", // // --no-cache only used to make --watch work. Otherwise jest ignores the breakpoints. // // https://github.com/facebook/jest/issues/6683 diff --git a/src/Juno/JunoClient.ts b/src/Juno/JunoClient.ts index 3df4dcc81..e135d7a4a 100644 --- a/src/Juno/JunoClient.ts +++ b/src/Juno/JunoClient.ts @@ -485,7 +485,7 @@ export class JunoClient { // public for tests public static getJunoEndpoint(): string { const junoEndpoint = userContext.features.junoEndpoint ?? configContext.JUNO_ENDPOINT; - if (validateEndpoint(junoEndpoint, configContext.allowedJunoOrigins)) { + if (!validateEndpoint(junoEndpoint, configContext.allowedJunoOrigins)) { const error = `${junoEndpoint} not allowed as juno endpoint`; console.error(error); throw new Error(error); diff --git a/src/Phoenix/PhoenixClient.ts b/src/Phoenix/PhoenixClient.ts index d0abb61de..1c1f9d6b1 100644 --- a/src/Phoenix/PhoenixClient.ts +++ b/src/Phoenix/PhoenixClient.ts @@ -155,7 +155,7 @@ export class PhoenixClient { public static getPhoenixEndpoint(): string { const phoenixEndpoint = userContext.features.phoenixEndpoint ?? userContext.features.junoEndpoint ?? configContext.JUNO_ENDPOINT; - if (validateEndpoint(phoenixEndpoint, configContext.allowedJunoOrigins)) { + if (!validateEndpoint(phoenixEndpoint, configContext.allowedJunoOrigins)) { const error = `${phoenixEndpoint} not allowed as juno endpoint`; console.error(error); throw new Error(error);