From 1ff125a4776baeace5d9abd3abbc6e08b04c034a Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 19 Dec 2017 15:01:00 -0200 Subject: [PATCH] fix regexp server validation (#140) --- app/lib/rocketchat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 1cb08a98a..97faaac0b 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -42,7 +42,7 @@ const RocketChat = { } }, async testServer(url) { - if (/^(https?:\/\/)?(((\w|[0-9])+(\.(\w|[0-9-_])+)+)|localhost)(:\d+)?$/.test(url)) { + if (/^(https?:\/\/)?(((\w|[0-9-_])+(\.(\w|[0-9-_])+)+)|localhost)(:\d+)?$/.test(url)) { const response = await fetch(url, { method: 'HEAD' }); if (response.status === 200 && response.headers.get('x-instance-id') != null && response.headers.get('x-instance-id').length) { return url;