Update /_health to accept GET requests (#8234)

Signed-off-by: David Mauskop <david@render.com>
This commit is contained in:
davidmauskop 2020-10-08 00:33:32 -07:00 committed by GitHub
parent e87af3f6c6
commit 43ff63cc38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -277,7 +277,7 @@ class Strapi {
async load() {
this.app.use(async (ctx, next) => {
if (ctx.request.url === '/_health' && ctx.request.method === 'HEAD') {
if (ctx.request.url === '/_health' && ['HEAD', 'GET'].includes(ctx.request.method)) {
ctx.set('strapi', 'You are so French!');
ctx.status = 204;
} else {