Fixed the test breakage on Linux where the local host name is returned as 'localhost.localdomain'
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1128917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e30d68d9f0
commit
4acba49325
|
@ -614,6 +614,7 @@ public class TestDefaultClientRequestDirector extends BasicServerTestBase {
|
|||
@Test
|
||||
public void testDefaultHostHeader() throws Exception {
|
||||
int port = this.localServer.getServiceAddress().getPort();
|
||||
String hostname = getServerHttp().getHostName();
|
||||
this.localServer.register("*", new SimpleService());
|
||||
|
||||
HttpContext context = new BasicHttpContext();
|
||||
|
@ -633,7 +634,7 @@ public class TestDefaultClientRequestDirector extends BasicServerTestBase {
|
|||
Header[] headers = reqWrapper.getHeaders("host");
|
||||
Assert.assertNotNull(headers);
|
||||
Assert.assertEquals(1, headers.length);
|
||||
Assert.assertEquals("localhost:"+port,headers[0].getValue());
|
||||
Assert.assertEquals(hostname + ":" + port, headers[0].getValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue