disable automatic redirect handling

This commit is contained in:
Noah Levitt
2012-08-21 15:48:06 -07:00
parent 6941842fa8
commit bc30eabe72
2 changed files with 10 additions and 7 deletions
@@ -822,6 +822,9 @@ public class FetchHTTP2 extends AbstractFetchHTTP implements Lifecycle {
protected RecordingHttpClient getHttpClient() {
if (httpClient == null) {
httpClient = new RecordingHttpClient(getServerCache());
// XXX should this in the constructor? in configureRequest()? somewhere else?
HttpClientParams.setRedirecting(httpClient.getParams(), false);
}
return httpClient;
@@ -64,13 +64,13 @@ public class RecordingHttpClient extends DefaultHttpClient {
this.setServerCache(serverCache);
// XXX uhh? see HeritrixHttpMethodRetryHandler ??
setHttpRequestRetryHandler(new HttpRequestRetryHandler() {
@Override
public boolean retryRequest(IOException exception, int executionCount,
HttpContext context) {
return false;
}
});
// setHttpRequestRetryHandler(new HttpRequestRetryHandler() {
// @Override
// public boolean retryRequest(IOException exception, int executionCount,
// HttpContext context) {
// return false;
// }
// });
// never reuse (no keep-alive)
setReuseStrategy(new ConnectionReuseStrategy() {