[grid] It seems that keep-alive works well in Passthrough, so deleting this test
import static java.net.HttpURLConnection.HTTP_OK;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
import com.google.common.io.ByteStreams;
@@ -71,22 +70,6 @@ public void shouldForwardRequestsToEndPoint() throws IOException {
assertEquals("Cake", server.lastRequest.getHeader("x-cheese"));
}
- @Test
- public void shouldStripKeepAliveHeader() throws IOException {
- SessionCodec handler = new Passthrough(server.url);
- HttpRequest req = new HttpRequest(HttpMethod.GET, "/ok");
- req.addHeader("Keep-Alive", "timeout=600");
- req.addHeader("Connection", "Keep-Alive, Upgrade");
- HttpResponse resp = new HttpResponse();
- handler.handle(req, resp);
-
- assertNull(server.lastRequest.getHeader("keep-alive"));
- // Not, we must set the connection to `close` in order to have the JVM avoid attempting to keep
- // the url connection open.
- // http://docs.oracle.com/javase/6/docs/technotes/guides/net/http-keepalive.html
- assertEquals("close", server.lastRequest.getHeader("connection"));
- }
-
private static class Server {
private final URL url;
private final HttpServer server;
