Fixed xoa-updater-service url

This commit is contained in:
Fabrice Marsaud
2015-05-30 14:24:57 +02:00
parent 6dcaf80f3f
commit e355e4d35d

View File

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