Changed test case failing in TravisCI due to what might be a local host name resolution problem

This commit is contained in:
Oleg Kalnichevski 2017-11-25 10:52:23 +01:00
parent 8f8efa9d6e
commit e89bbbbb44
1 changed files with 1 additions and 2 deletions

View File

@ -451,10 +451,9 @@ public class TestClientAuthentication extends LocalServerTestBase {
final HttpContext context) throws HttpException, IOException { final HttpContext context) throws HttpException, IOException {
final EndpointDetails endpoint = (EndpointDetails) context.getAttribute(HttpCoreContext.CONNECTION_ENDPOINT); final EndpointDetails endpoint = (EndpointDetails) context.getAttribute(HttpCoreContext.CONNECTION_ENDPOINT);
final InetSocketAddress socketAddress = (InetSocketAddress) endpoint.getLocalAddress(); final InetSocketAddress socketAddress = (InetSocketAddress) endpoint.getLocalAddress();
final String localhost = socketAddress.getHostName();
final int port = socketAddress.getPort(); final int port = socketAddress.getPort();
response.setCode(HttpStatus.SC_MOVED_PERMANENTLY); response.setCode(HttpStatus.SC_MOVED_PERMANENTLY);
response.addHeader(new BasicHeader("Location", "http://test:test@" + localhost + ":" + port + "/secure")); response.addHeader(new BasicHeader("Location", "http://test:test@localhost:" + port + "/secure"));
} }
}); });