Make sure query is a string

This commit is contained in:
Vjacheslav Trushkin 2019-02-12 14:08:35 +02:00
parent 0f11b4a903
commit 6c7fbd0f96
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ module.exports = (app, req, res, query) => {
app.response(req, res, 200);
// Do stuff
if (app.config['reload-secret'].length && req.query && req.query.key && req.query.key === app.config['reload-secret'] && !app.reloading) {
if (app.config['reload-secret'].length && req.query && typeof req.query.key === 'string' && req.query.key === app.config['reload-secret'] && !app.reloading) {
process.nextTick(() => {
app.reload(false).then(() => {
}).catch(err => {
@ -60,7 +60,7 @@ module.exports = (app, req, res, query) => {
app.response(req, res, 200);
let repo = req.query.repo;
if (!app.config.canSync || !app.config.sync[repo] || !app.config.sync.git || !app.config.sync.secret) {
if (typeof repo !== 'string' || !app.config.canSync || !app.config.sync[repo] || !app.config.sync.git || !app.config.sync.secret) {
return;
}