Skip to content

Commit d43c7d7

Browse files
authored
Re-add support for configuring server.host: "0" (#86806) (#86830)
Support for this was lost in #85406. Fixes #86716
1 parent 26160e2 commit d43c7d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/server/http/http_config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,13 @@ export class HttpConfig {
195195
rawExternalUrlConfig: ExternalUrlConfig
196196
) {
197197
this.autoListen = rawHttpConfig.autoListen;
198-
this.host = rawHttpConfig.host;
198+
// TODO: Consider dropping support for '0' in v8.0.0. This value is passed
199+
// to hapi, which validates it. Prior to hapi v20, '0' was considered a
200+
// valid host, however the validation logic internally in hapi was
201+
// re-written for v20 and hapi no longer considers '0' a valid host. For
202+
// details, see:
203+
// https://github.com/elastic/kibana/issues/86716#issuecomment-749623781
204+
this.host = rawHttpConfig.host === '0' ? '0.0.0.0' : rawHttpConfig.host;
199205
this.port = rawHttpConfig.port;
200206
this.cors = rawHttpConfig.cors;
201207
this.customResponseHeaders = Object.entries(rawHttpConfig.customResponseHeaders ?? {}).reduce(

0 commit comments

Comments
 (0)