@Test
public void testManualContinueWithNestedInterceptor() throws Exception {
IHttpRequestHandler interceptor = new IHttpRequestHandler() {
@Supports100Continue
public void onRequest(final IHttpExchange exchange) throws IOException, BadMessageException {
IHttpRequest request = exchange.getRequest();
request.addHeader("X-Intercepted1", "true");
IHttpResponseHandler hdl = new IHttpResponseHandler() {
public void onResponse(IHttpResponse response) throws IOException {
response.addHeader("X-Intercepted1", "true");
exchange.send(response);
}
public void onException(IOException ioe) throws IOException {
exchange.sendError(ioe);
}
};
exchange.forward(request, hdl);
}
};
IHttpRequestHandler interceptor2 = new IHttpRequestHandler() {
@Supports100Continue
public void onRequest(final IHttpExchange exchange) throws IOException, BadMessageException {
IHttpRequest request = exchange.getRequest();
request.addHeader("X-Intercepted2", "true");