From f05f3deb1702572cb8831e97f676991300b38cda Mon Sep 17 00:00:00 2001 From: ekzyis Date: Sat, 20 May 2023 02:50:56 +0200 Subject: [PATCH] Fix ensureProtocol not trimming whitespace --- lib/url.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/url.js b/lib/url.js index 4b142542..34feba5a 100644 --- a/lib/url.js +++ b/lib/url.js @@ -1,4 +1,5 @@ export function ensureProtocol (value) { + value = value.trim() if (!/^([a-z0-9]+:\/\/|mailto:)/.test(value)) { value = 'http://' + value }