mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 21:53:46 -05:00
Merge pull request #3421 from overleaf/bg-fix-health-checks-for-web-closed
fix load balancer health checks for web-closed GitOrigin-RevId: f46ecec4539740bc4f0324944b2b4d6273025211
This commit is contained in:
parent
ce853aa17e
commit
cde6160973
2 changed files with 20 additions and 1 deletions
|
@ -139,7 +139,12 @@ module.exports = HttpErrorHandler = {
|
|||
},
|
||||
|
||||
maintenance(req, res) {
|
||||
// load balancer health checks require a success response for /
|
||||
if (req.url === '/') {
|
||||
res.status(200)
|
||||
} else {
|
||||
res.status(503)
|
||||
}
|
||||
let message = `${Settings.appName} is currently down for maintenance.`
|
||||
if (Settings.statusPageUrl) {
|
||||
message += ` Please check https://${Settings.statusPageUrl} for updates.`
|
||||
|
|
|
@ -49,5 +49,19 @@ describe('siteIsOpen', function() {
|
|||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should return a 200 on / for load balancer health checks', function(done) {
|
||||
request.get('/', (error, response, body) => {
|
||||
response.statusCode.should.equal(200)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should return a 200 on /status for readiness checks', function(done) {
|
||||
request.get('/status', (error, response, body) => {
|
||||
response.statusCode.should.equal(200)
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue