From 3088c70d63fc31a9046caef5cae2f38287c59bef Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 26 May 2021 10:14:34 +0200 Subject: [PATCH] [7.x] Re-add support for configuring server.host: "0" (#100551) Support for this was lost in #100378. --- src/core/server/http/http_config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/server/http/http_config.ts b/src/core/server/http/http_config.ts index 5edd520f4fda07..88e04fd715f7b3 100644 --- a/src/core/server/http/http_config.ts +++ b/src/core/server/http/http_config.ts @@ -216,7 +216,13 @@ export class HttpConfig implements IHttpConfig { rawExternalUrlConfig: ExternalUrlConfig ) { this.autoListen = rawHttpConfig.autoListen; - this.host = rawHttpConfig.host; + // TODO: Consider dropping support for '0' in v8.0.0. This value is passed + // to hapi, which validates it. Prior to hapi v20, '0' was considered a + // valid host, however the validation logic internally in hapi was + // re-written for v20 and hapi no longer considers '0' a valid host. For + // details, see: + // https://github.com/elastic/kibana/issues/86716#issuecomment-749623781 + this.host = rawHttpConfig.host === '0' ? '0.0.0.0' : rawHttpConfig.host; this.port = rawHttpConfig.port; this.cors = rawHttpConfig.cors; const { securityResponseHeaders, disableEmbedding } = parseRawSecurityResponseHeadersConfig(