From f17ce939e2242c00d52cc9e51ea62eb7abee679d Mon Sep 17 00:00:00 2001 From: Will Murphy Date: Wed, 25 Dec 2019 17:22:31 -0500 Subject: [PATCH] fix errors in unverifiable delete handling and include accept headerin http logs --- index.js | 2 +- net/security.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index cb72f4f..4822a7e 100644 --- a/index.js +++ b/index.js @@ -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: [ diff --git a/net/security.js b/net/security.js index f5005b5..e6ac560 100644 --- a/net/security.js +++ b/net/security.js @@ -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()