From 4ba4a92e68626f3ea2a909aa1c5a4bde15ca38c8 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 28 Nov 2021 23:59:57 -0600 Subject: [PATCH] Invalidate unsecure urls by default --- helpers/check-types.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helpers/check-types.js b/helpers/check-types.js index ef13e3b..6c9dc51 100644 --- a/helpers/check-types.js +++ b/helpers/check-types.js @@ -15,7 +15,11 @@ export function isValidHttpUrl( maybeUrl, allowUnsecure = false ) { return false } - return url.protocol === "http:" || url.protocol === "https:" + if ( allowUnsecure ) { + return url.protocol === "http:" || url.protocol === "https:" + } + + return url.protocol === "https:" } export function isObject( maybeObject ) {