From d73e9795a358818ce0f8c0e4ef0152f4a1fba745 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa Date: Fri, 19 Apr 2024 22:29:35 +0530 Subject: [PATCH] fix: whitelist 127.0.0.1 for local dev --- src/orca-loader/Hyper.res | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index 47c3f108e..c7367126c 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -132,7 +132,10 @@ let make = (publishableKey, options: option, analyticsInfo: optionSentry.sentryLogger let isSecure = Window.protocol === "https:" - let isLocal = GlobalVars.sdkUrl->String.includes("localhost") + let isLocal = + ["localhost", "127.0.0.1"] + ->Array.find(url => GlobalVars.sdkUrl->String.includes(url)) + ->Option.isSome if !isSecure && !isLocal { manageErrorWarning(HTTP_NOT_ALLOWED, ~dynamicStr=Window.href, ~logger, ()) Exn.raiseError("Insecure domain: " ++ Window.href)