Fix Juno and Phoenix validations

This commit is contained in:
artrejo 2022-01-21 08:20:29 -08:00
parent 1b1371381e
commit 899d7459c1
3 changed files with 6 additions and 4 deletions

6
.vscode/launch.json vendored
View File

@ -12,7 +12,8 @@
"--inspect-brk", "--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js", "${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand", "--runInBand",
"--coverage", "false" "--coverage",
"false"
], ],
"console": "integratedTerminal", "console": "integratedTerminal",
"internalConsoleOptions": "neverOpen", "internalConsoleOptions": "neverOpen",
@ -26,7 +27,8 @@
"--inspect-brk", "--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js", "${workspaceRoot}/node_modules/jest/bin/jest.js",
"${fileBasenameNoExtension}", "${fileBasenameNoExtension}",
"--coverage", "false", "--coverage",
"false",
// "--watch", // "--watch",
// // --no-cache only used to make --watch work. Otherwise jest ignores the breakpoints. // // --no-cache only used to make --watch work. Otherwise jest ignores the breakpoints.
// // https://github.com/facebook/jest/issues/6683 // // https://github.com/facebook/jest/issues/6683

View File

@ -485,7 +485,7 @@ export class JunoClient {
// public for tests // public for tests
public static getJunoEndpoint(): string { public static getJunoEndpoint(): string {
const junoEndpoint = userContext.features.junoEndpoint ?? configContext.JUNO_ENDPOINT; 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`; const error = `${junoEndpoint} not allowed as juno endpoint`;
console.error(error); console.error(error);
throw new Error(error); throw new Error(error);

View File

@ -155,7 +155,7 @@ export class PhoenixClient {
public static getPhoenixEndpoint(): string { public static getPhoenixEndpoint(): string {
const phoenixEndpoint = const phoenixEndpoint =
userContext.features.phoenixEndpoint ?? userContext.features.junoEndpoint ?? configContext.JUNO_ENDPOINT; 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`; const error = `${phoenixEndpoint} not allowed as juno endpoint`;
console.error(error); console.error(error);
throw new Error(error); throw new Error(error);