upgraded express
This commit is contained in:
parent
8b0159d099
commit
e41e5d7ac7
3 changed files with 17 additions and 15 deletions
|
|
@ -77,7 +77,7 @@ function poll (req, res) {
|
|||
} catch (e) {
|
||||
if (e instanceof E.NoDataError) {
|
||||
logger.debug(e)
|
||||
return res.send(500)
|
||||
return res.sendStatus(500)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -232,8 +232,8 @@ function phoneCode (req, res) {
|
|||
.then(code => res.json({code: code}))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
if (err.name === 'BadNumberError') return res.send(410)
|
||||
return res.send(500)
|
||||
if (err.name === 'BadNumberError') return res.sendStatus(410)
|
||||
return res.sendStatus(500)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ function updatePhone (req, res) {
|
|||
.then(code => res.json(200))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ function fetchPhoneTx (req, res) {
|
|||
.then(r => res.json(r))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -261,20 +261,20 @@ function registerRedeem (req, res) {
|
|||
.then(() => res.json({success: true}))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
})
|
||||
}
|
||||
|
||||
function waitForDispense (req, res) {
|
||||
return plugins.fetchTx(session(req))
|
||||
.then(tx => {
|
||||
if (!tx) return res.send(404)
|
||||
if (tx.status === req.query.status) return res.send(304)
|
||||
if (!tx) return res.sendStatus(404)
|
||||
if (tx.status === req.query.status) return res.sendStatus(304)
|
||||
res.json({tx: tx})
|
||||
})
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ function dispense (req, res) {
|
|||
.then(() => res.json(200))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.send(500)
|
||||
res.sendStatus(500)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -329,11 +329,11 @@ function init (localConfig) {
|
|||
console.log('pid: %s, fingerprint: %s', pid, fingerprint)
|
||||
|
||||
if (!fingerprint || !pid) {
|
||||
return res.send(400)
|
||||
return res.sendStatus(400)
|
||||
}
|
||||
|
||||
reboots[fingerprint] = pid
|
||||
res.send(200)
|
||||
res.sendStatus(200)
|
||||
})
|
||||
|
||||
return app
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue