X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fcommon.js;fp=lib%2Fcommon.js;h=60e0d20a24ef7008cc189b5103e03278ce6e7302;hb=446a6e8fa160483e1c48a575e60a636c9f37927a;hp=e2e2a8c640f58ba4df827cd6e7afcc5ffb69fd4b;hpb=1296167385b38ca226f17c3a87ac2135d53c769b;p=squeep-api-dingus diff --git a/lib/common.js b/lib/common.js index e2e2a8c..60e0d20 100644 --- a/lib/common.js +++ b/lib/common.js @@ -38,7 +38,7 @@ const fileScope = (filename) => { */ const generateETag = (_filePath, fileStat, fileData) => { const hash = crypto.createHash('sha256'); - if (fileStat && fileStat.mtimeMs) { + if (fileStat?.mtimeMs) { hash.update(fileStat.mtimeMs.toString()); } hash.update(fileData); @@ -197,7 +197,7 @@ const requestLogData = (req) => { * @deprecated after v1.2.5 (integrated into logger module) */ const scrubHeaderObject = (data) => { - if (data && data.headers && 'authorization' in data.headers) { + if (data?.headers && 'authorization' in data.headers) { data.headers = Object.assign({}, data.headers, { authorization: obscureAuthorizationHeader(data.headers['authorization']), });