Skip to content

Commit

Permalink
introduced proxy status in proxy response handler
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamhead committed Jan 10, 2019
1 parent ac8573c commit f0847a0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ public abstract class AbstractProxyResponseHandler extends AbstractHttpResponseH

private static Logger logger = LoggerFactory.getLogger(AbstractProxyResponseHandler.class);

private final int proxyStatus;
private final Failover failover;

protected AbstractProxyResponseHandler(final Failover failover) {
this.failover = failover;
this.proxyStatus = HttpResponseStatus.BAD_REQUEST.code();
}

private HttpRequestBase prepareRemoteRequest(final FullHttpRequest request, final URL url) {
Expand Down Expand Up @@ -204,7 +206,7 @@ private HttpResponse setupResponse(final HttpRequest request,

private boolean shouldFailover(final org.apache.http.HttpResponse remoteResponse) {
int statusCode = remoteResponse.getStatusLine().getStatusCode();
return statusCode == HttpResponseStatus.BAD_REQUEST.code();
return statusCode == proxyStatus;
}

private HttpResponse setupNormalResponse(final org.apache.http.HttpResponse remoteResponse) throws IOException {
Expand Down

0 comments on commit f0847a0

Please sign in to comment.