Skip to content

Commit

Permalink
Fix #12356 Do not send keep-alive when not persistent
Browse files Browse the repository at this point in the history
updates from test failures
  • Loading branch information
gregw committed Oct 14, 2024
1 parent 0ff4509 commit 2702625
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ public void testBasicHttp10Request() throws IOException

ByteBuffer bBuff = request.generate();

StringBuffer expectedRequest = new StringBuffer();
expectedRequest.append("GET /uri HTTP/1.0\r\n");
expectedRequest.append("Host: fakehost\r\n");
expectedRequest.append("\r\n");
String expectedRequest = """
GET /uri HTTP/1.0\r
Host: fakehost\r
\r
""";

assertEquals(expectedRequest.toString(), BufferUtil.toString(bBuff), "Basic Request");
assertEquals(expectedRequest, BufferUtil.toString(bBuff), "Basic Request");
}

@Test
Expand All @@ -57,14 +58,14 @@ public void testBasicHttp11Request() throws IOException

ByteBuffer bBuff = request.generate();

StringBuffer expectedRequest = new StringBuffer();
expectedRequest.append("GET /uri HTTP/1.1\r\n");
expectedRequest.append("Host: fakehost\r\n");
expectedRequest.append("Connection: close\r\n");
expectedRequest.append("Content-Length: 3\r\n");
expectedRequest.append("\r\n");
expectedRequest.append("aaa");
String expectedRequest = """
GET /uri HTTP/1.1\r
Host: fakehost\r
Content-Length: 3\r
Connection: close\r
\r
aaa""";

assertEquals(expectedRequest.toString(), BufferUtil.toString(bBuff), "Basic Request");
assertEquals(expectedRequest, BufferUtil.toString(bBuff), "Basic Request");
}
}

0 comments on commit 2702625

Please sign in to comment.