mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #2978 from overleaf/jpa-expose-hostname
[misc] optionally expose the hostname in the X-Served-By response header GitOrigin-RevId: f3ac14aeb75cef8c9ed1d8cb1d649dd7f909b99b
This commit is contained in:
parent
f0f29e2f17
commit
ae068781ca
2 changed files with 10 additions and 0 deletions
|
@ -72,6 +72,13 @@ if (Settings.behindProxy) {
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (Settings.exposeHostname) {
|
||||||
|
const HOSTNAME = require('os').hostname()
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
res.setHeader('X-Served-By', HOSTNAME)
|
||||||
|
next()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
webRouter.use(
|
webRouter.use(
|
||||||
express.static(Path.join(__dirname, '/../../../public'), {
|
express.static(Path.join(__dirname, '/../../../public'), {
|
||||||
|
|
|
@ -418,6 +418,9 @@ module.exports = settings =
|
||||||
# address and http/https protocol information.
|
# address and http/https protocol information.
|
||||||
behindProxy: false
|
behindProxy: false
|
||||||
|
|
||||||
|
# Expose the hostname in the `X-Served-By` response header
|
||||||
|
exposeHostname: process.env['EXPOSE_HOSTNAME'] == 'true'
|
||||||
|
|
||||||
# Cookie max age (in milliseconds). Set to false for a browser session.
|
# Cookie max age (in milliseconds). Set to false for a browser session.
|
||||||
cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
|
cookieSessionLength: 5 * 24 * 60 * 60 * 1000 # 5 days
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue