I am redirecting requests to real services with
HiveContextTest(ClientAndServer mockServer) {
this.mockServer = mockServer;
}
...
my test {
mockServer.when(
HttpRequest.request()
.withPath("/hive-tables.*")
).forward(
forward()
.withHost("real.service.host")
.withPort(443)
.withScheme(HttpForward.Scheme.HTTPS)
);
}
Unfortunately, this forward adds header with old host
curl -v 'https://old.host/hive-tables...' ... -H 'Host: old.host'
and this confuses the service.
Is it possible to prevent the Host header to be added?