Upgrade server deps (#10017)

* remove unused apn lib and upgrade moment-recur

* upgrade validator

* upgrade got

* request -> got

* fix validation

* fix tests

* upgrade nodemailer

* fix unit tests

* fix webhook tests, upgrade express-validator (using legacy api)

* upgrade js2xmlparser

* update misc packages

* fix linting

* update packages
This commit is contained in:
Matteo Pagliazzi
2018-02-23 15:21:00 +01:00
committed by GitHub
parent cea47e5280
commit 3a1e56cc8e
18 changed files with 646 additions and 397 deletions

View File

@@ -247,7 +247,7 @@ api.loginLocal = {
let username = req.body.username;
let password = req.body.password;
if (validator.isEmail(username)) {
if (validator.isEmail(String(username))) {
login = {'auth.local.email': username.toLowerCase()}; // Emails are stored lowercase
} else {
login = {'auth.local.username': username};
@@ -410,7 +410,7 @@ api.pusherAuth = {
}
resourceId = resourceId.join('-'); // the split at the beginning had split resourceId too
if (!validator.isUUID(resourceId)) {
if (!validator.isUUID(String(resourceId))) {
throw new BadRequest('Invalid Pusher resource id, must be a UUID.');
}

View File

@@ -144,7 +144,12 @@ api.exportUserDataXml = {
'Content-Type': 'text/xml',
'Content-disposition': 'attachment; filename=habitica-user-data.xml',
});
res.status(200).send(js2xml('user', userData));
res.status(200).send(js2xml.parse('user', userData, {
cdataInvalidChars: true,
declaration: {
include: false,
},
}));
},
};