Skip to content

Commit

Permalink
fix: whitelist 127.0.0.1 for local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrishab Srivatsa committed Apr 19, 2024
1 parent c6f6965 commit d73e979
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/orca-loader/Hyper.res
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ let make = (publishableKey, options: option<JSON.t>, analyticsInfo: option<JSON.
}
}->Sentry.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)
Expand Down

0 comments on commit d73e979

Please sign in to comment.