From 826c7c47785ee01d2b9267919132ada696425344 Mon Sep 17 00:00:00 2001 From: Melonai Date: Wed, 20 Jan 2021 23:18:09 +0100 Subject: Remade the client in SvelteKit --- client/src/utils/addProtocol.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 client/src/utils/addProtocol.ts (limited to 'client/src/utils/addProtocol.ts') diff --git a/client/src/utils/addProtocol.ts b/client/src/utils/addProtocol.ts new file mode 100644 index 0000000..75c6214 --- /dev/null +++ b/client/src/utils/addProtocol.ts @@ -0,0 +1,6 @@ +export default function (url: string) { + if (!/^https?:\/\//.test(url)) { + url = "https://" + url; + } + return url; +} -- cgit 1.4.1