From e355e4d35dd5cf223ff08af128eb170318d09182 Mon Sep 17 00:00:00 2001 From: Fabrice Marsaud Date: Sat, 30 May 2015 14:24:57 +0200 Subject: [PATCH] Fixed xoa-updater-service url --- app/modules/updater/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/modules/updater/index.js b/app/modules/updater/index.js index 625816807..fe1f410ec 100644 --- a/app/modules/updater/index.js +++ b/app/modules/updater/index.js @@ -33,11 +33,11 @@ function getCurrentUrl () { } function adaptUrl (url, port = null) { - const matches = /^https?:\/\/([^\/:]*(?::[^\/]*)?)(?:[^:]*)?$/.exec(url) - if (!matches || !matches[1]) { + const matches = /^http(s?):\/\/([^\/:]*(?::[^\/]*)?)(?:[^:]*)?$/.exec(url) + if (!matches || !matches[2]) { throw new Error('current URL not recognized') } - return 'ws://' + matches[1] + '/api/updater' + return 'ws' + matches[1] + '://' + matches[2] + '/api/updater' } function blockXoaAccess (xoaState) {