mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 00:15:13 -04:00
Send etherpad version in update check request
This commit is contained in:
parent
293bd64522
commit
94ad1a594d
1 changed files with 16 additions and 14 deletions
|
@ -2,10 +2,13 @@
|
||||||
const semver = require('semver');
|
const semver = require('semver');
|
||||||
const settings = require('./Settings');
|
const settings = require('./Settings');
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
const headers = {
|
||||||
|
'User-Agent': 'Etherpad ' + settings.getEpVersion(),
|
||||||
|
}
|
||||||
let infos;
|
let infos;
|
||||||
|
|
||||||
const loadEtherpadInformations = () =>
|
const loadEtherpadInformations = () =>
|
||||||
axios.get('https://static.etherpad.org/info.json')
|
axios.get('https://static.etherpad.org/info.json', {headers: headers})
|
||||||
.then(async resp => {
|
.then(async resp => {
|
||||||
try {
|
try {
|
||||||
infos = await resp.data;
|
infos = await resp.data;
|
||||||
|
@ -14,8 +17,7 @@ const loadEtherpadInformations = () =>
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return await Promise.resolve(infos);
|
return await Promise.resolve(infos);
|
||||||
}
|
} catch (err) {
|
||||||
catch (err) {
|
|
||||||
return await Promise.reject(err);
|
return await Promise.reject(err);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue