From 2f1708b0c352acbfdb20e23e48af1c1d6e76ba8c Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Tue, 19 Nov 2019 16:58:24 -0300 Subject: [PATCH] [FIX] Prevent server with whitespace (#1402) --- app/views/NewServerView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/NewServerView.js b/app/views/NewServerView.js index adea48ea2..1d60409d6 100644 --- a/app/views/NewServerView.js +++ b/app/views/NewServerView.js @@ -175,7 +175,7 @@ class NewServerView extends React.Component { } completeUrl = (url) => { - url = url && url.trim(); + url = url && url.replace(/\s/g, ''); if (/^(\w|[0-9-_]){3,}$/.test(url) && /^(htt(ps?)?)|(loca((l)?|(lh)?|(lho)?|(lhos)?|(lhost:?\d*)?)$)/.test(url) === false) {