Issue #989 - InputStreamResponseListener.get() throws with HTTP/2 following redirect.
Added test case, but it passes cleanly.
This commit is contained in:
parent
f305bf8a2d
commit
f9e3c535d6
|
@ -1163,4 +1163,32 @@ public class HttpClientStreamTest extends AbstractTest
|
|||
Response response = listener.get(5, TimeUnit.SECONDS);
|
||||
Assert.assertEquals(200, response.getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInputStreamResponseListenerWithRedirect() throws Exception
|
||||
{
|
||||
start(new AbstractHandler()
|
||||
{
|
||||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
baseRequest.setHandled(true);
|
||||
if (target.startsWith("/303"))
|
||||
response.sendRedirect("/200");
|
||||
}
|
||||
});
|
||||
|
||||
InputStreamResponseListener listener = new InputStreamResponseListener();
|
||||
client.newRequest("localhost", connector.getLocalPort())
|
||||
.scheme(getScheme())
|
||||
.path("/303")
|
||||
.followRedirects(true)
|
||||
.send(listener);
|
||||
|
||||
Response response = listener.get(5, TimeUnit.SECONDS);
|
||||
Assert.assertEquals(HttpStatus.OK_200, response.getStatus());
|
||||
|
||||
Result result = listener.await(5, TimeUnit.SECONDS);
|
||||
Assert.assertTrue(result.isSucceeded());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue