diff --git a/src/Utils/EndpointValidation.ts b/src/Utils/EndpointValidation.ts index 4b258eafc..2b255f3fa 100644 --- a/src/Utils/EndpointValidation.ts +++ b/src/Utils/EndpointValidation.ts @@ -7,6 +7,10 @@ export function validateEndpoint(endpointToValidate: string | undefined, allowed } function validateEndpointInternal(endpointToValidate: string | undefined, allowedEndpoints: string[]): boolean { + if (endpointToValidate === undefined) { + return false; + } + const originToValidate: string = new URL(endpointToValidate).origin; const allowedOrigins: string[] = allowedEndpoints.map((allowedEndpoint) => new URL(allowedEndpoint).origin) || []; const valid = allowedOrigins.indexOf(originToValidate) >= 0; @@ -39,14 +43,14 @@ export const allowedMongoProxyEndpoints: ReadonlyArray = [ export const allowedEmulatorEndpoints: ReadonlyArray = ["https://localhost:8081"]; +export const allowedMongoBackendEndpoints: ReadonlyArray = ["https://localhost:1234"]; + export const allowedGraphEndpoints: ReadonlyArray = []; export const allowedArcadiaEndpoints: ReadonlyArray = []; export const allowedArcadiaLivyDnsZones: ReadonlyArray = []; -export const allowedMongoBackendEndpoints: ReadonlyArray = ["https://localhost:1234"]; - export const allowedHostedExplorerEndpoints: ReadonlyArray = []; export const allowedMsalRedirectEndpoints: ReadonlyArray = [];