fix errors in unverifiable delete handling and include accept headerin http logs

This commit is contained in:
Will Murphy 2019-12-25 17:22:31 -05:00
parent 4a0337bdad
commit f17ce939e2
2 changed files with 4 additions and 3 deletions

View file

@ -27,7 +27,7 @@ const sslOptions = {
app.set('domain', DOMAIN)
app.set('port', process.env.PORT || PORT)
app.set('port-https', process.env.PORT_HTTPS || PORT_HTTPS)
app.use(morgan('combined'))
app.use(morgan(':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status Accepts ":req[accept]" ":referrer" ":user-agent"'))
app.use(history({
index: '/web/index.html',
rewrites: [

View file

@ -35,9 +35,10 @@ async function verifySignature (req, res, next) {
}
next()
} catch (err) {
if (req.body.type === 'Delete' && err.mesage.startsWith('410')) {
if (req.body.type === 'Delete' && err.message.startsWith('410')) {
// user delete message that can't be verified because we don't have the user cached
res.status(200).send()
console.log('Unverifiable delete')
return res.status(200).send()
}
console.log('error during signature verification', err.message, req.body)
return res.status(500).send()