Merge pull request #1938 from licy183/fix-logger

This commit is contained in:
David Mehren 2022-01-06 19:46:52 +01:00 committed by GitHub
commit fe98f63149
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

6
app.js
View file

@ -63,8 +63,14 @@ if (!config.useSSL && config.protocolUseSSL) {
app.set('trust proxy', 1)
}
// check if the request is from container healthcheck
function isContainerHealthCheck (req, _) {
return req.headers['user-agent'] === 'hedgedoc-container-healthcheck/1.0' && req.ip === '127.0.0.1'
}
// logger
app.use(morgan('combined', {
skip: isContainerHealthCheck,
stream: logger.stream
}))