mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-08 16:05:05 -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 settings = require('./Settings');
|
||||
const axios = require('axios');
|
||||
const headers = {
|
||||
'User-Agent': 'Etherpad ' + settings.getEpVersion(),
|
||||
}
|
||||
let infos;
|
||||
|
||||
const loadEtherpadInformations = () =>
|
||||
axios.get('https://static.etherpad.org/info.json')
|
||||
axios.get('https://static.etherpad.org/info.json', {headers: headers})
|
||||
.then(async resp => {
|
||||
try {
|
||||
infos = await resp.data;
|
||||
|
@ -14,8 +17,7 @@ const loadEtherpadInformations = () =>
|
|||
return
|
||||
}
|
||||
return await Promise.resolve(infos);
|
||||
}
|
||||
catch (err) {
|
||||
} catch (err) {
|
||||
return await Promise.reject(err);
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue