Skip to content

Commit

Permalink
fix protocol check so it passes with valid http/https urls
Browse files Browse the repository at this point in the history
URL.protocol returns protocol ending with `:` so it fails the check for http|https
  • Loading branch information
cmd430 authored Jul 24, 2022
1 parent 44f5a65 commit 728b342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Layout from "../layouts/Layout.astro";
try {
var urled = new URL(website);
// Make sure the URL is http or https
if (urled.protocol !== 'https' && urled.protocol !== 'http') {
if (urled.protocol !== 'https:' && urled.protocol !== 'http:') {
Toastify({
text: "Invalid URL protocol.",
gravity: "top",
Expand Down

0 comments on commit 728b342

Please sign in to comment.