Skip to content

Instantly share code, notes, and snippets.

@jlandure
Created September 21, 2021 07:05
Show Gist options
  • Save jlandure/716841e6c9c0d3449ec229d179ba8e65 to your computer and use it in GitHub Desktop.
Save jlandure/716841e6c9c0d3449ec229d179ba8e65 to your computer and use it in GitHub Desktop.
http to https client
if (
typeof window !== "undefined"
&& window?.location?.protocol === "http:"
&& window?.location?.hostname !== "localhost"
) {
window.location.protocol = "https:"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment