419901 - Client always adds extra user-agent header.

Improved test case.
This commit is contained in:
Simone Bordet 2013-10-21 10:39:06 +02:00
parent b46af29a42
commit 7520389c91
1 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,7 @@ import org.eclipse.jetty.client.api.Response;
import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.client.api.Result;
import org.eclipse.jetty.client.util.BytesContentProvider; import org.eclipse.jetty.client.util.BytesContentProvider;
import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
@ -850,5 +851,13 @@ public class HttpClientTest extends AbstractHttpClientServerTest
.send(); .send();
Assert.assertEquals(200, response.getStatus()); Assert.assertEquals(200, response.getStatus());
response = client.newRequest("localhost", connector.getLocalPort())
.scheme(scheme)
.header(HttpHeader.USER_AGENT, userAgent)
.timeout(5, TimeUnit.SECONDS)
.send();
Assert.assertEquals(200, response.getStatus());
} }
} }