fix errors in unverifiable delete handling and include accept headerin http logs
This commit is contained in:
parent
4a0337bdad
commit
f17ce939e2
2 changed files with 4 additions and 3 deletions
2
index.js
2
index.js
|
@ -27,7 +27,7 @@ const sslOptions = {
|
||||||
app.set('domain', DOMAIN)
|
app.set('domain', DOMAIN)
|
||||||
app.set('port', process.env.PORT || PORT)
|
app.set('port', process.env.PORT || PORT)
|
||||||
app.set('port-https', process.env.PORT_HTTPS || PORT_HTTPS)
|
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({
|
app.use(history({
|
||||||
index: '/web/index.html',
|
index: '/web/index.html',
|
||||||
rewrites: [
|
rewrites: [
|
||||||
|
|
|
@ -35,9 +35,10 @@ async function verifySignature (req, res, next) {
|
||||||
}
|
}
|
||||||
next()
|
next()
|
||||||
} catch (err) {
|
} 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
|
// 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)
|
console.log('error during signature verification', err.message, req.body)
|
||||||
return res.status(500).send()
|
return res.status(500).send()
|
||||||
|
|
Loading…
Reference in a new issue