[FIX] Prevent server with whitespace (#1402)

This commit is contained in:
Diego Mello 2019-11-19 16:58:24 -03:00 committed by GitHub
parent 265c3e7385
commit 2f1708b0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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) {