Fix ensureProtocol not trimming whitespace

This commit is contained in:
ekzyis 2023-05-20 02:50:56 +02:00 committed by Keyan
parent 4af445d242
commit f05f3deb17
1 changed files with 1 additions and 0 deletions

View File

@ -1,4 +1,5 @@
export function ensureProtocol (value) { export function ensureProtocol (value) {
value = value.trim()
if (!/^([a-z0-9]+:\/\/|mailto:)/.test(value)) { if (!/^([a-z0-9]+:\/\/|mailto:)/.test(value)) {
value = 'http://' + value value = 'http://' + value
} }