@Override public void serverToProxyResponseReceiving() { for (HttpFilters filter : filters) { try { filter.serverToProxyResponseReceiving(); } catch (RuntimeException e) { log.warn("Filter in filter chain threw exception. Filter method may have been aborted.", e); } } }
@Override public void serverToProxyResponseReceiving() { delegate.serverToProxyResponseReceiving(); }
@Override public void serverToProxyResponseReceiving() { delegate.serverToProxyResponseReceiving(); }
@Override public void serverToProxyResponseReceiving() { for (HttpFilters filter : filters) { try { filter.serverToProxyResponseReceiving(); } catch (RuntimeException e) { log.warn("Filter in filter chain threw exception. Filter method may have been aborted.", e); } } }
@Override public void serverToProxyResponseReceiving() { for (HttpFilters filter : filters) { try { filter.serverToProxyResponseReceiving(); } catch (RuntimeException e) { log.warn("Filter in filter chain threw exception. Filter method may have been aborted.", e); } } }
@Override public void serverToProxyResponseReceiving() { for (HttpFilters filter : filters) { try { filter.serverToProxyResponseReceiving(); } catch (RuntimeException e) { log.warn("Filter in filter chain threw exception. Filter method may have been aborted.", e); } } }
@Override protected ConnectionState readHTTPInitial(HttpResponse httpResponse) { LOG.debug("Received raw response: {}", httpResponse); if (httpResponse.getDecoderResult().isFailure()) { LOG.debug("Could not parse response from server. Decoder result: {}", httpResponse.getDecoderResult().toString()); // create a "substitute" Bad Gateway response from the server, since we couldn't understand what the actual // response from the server was. set the keep-alive on the substitute response to false so the proxy closes // the connection to the server, since we don't know what state the server thinks the connection is in. FullHttpResponse substituteResponse = ProxyUtils.createFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_GATEWAY, "Unable to parse response from server"); HttpHeaders.setKeepAlive(substituteResponse, false); httpResponse = substituteResponse; } currentFilters.serverToProxyResponseReceiving(); rememberCurrentResponse(httpResponse); respondWith(httpResponse); if (ProxyUtils.isChunked(httpResponse)) { return AWAITING_CHUNK; } else { currentFilters.serverToProxyResponseReceived(); return AWAITING_INITIAL; } }
@Override protected ConnectionState readHTTPInitial(HttpResponse httpResponse) { LOG.debug("Received raw response: {}", httpResponse); if (httpResponse.getDecoderResult().isFailure()) { LOG.debug("Could not parse response from server. Decoder result: {}", httpResponse.getDecoderResult().toString()); // create a "substitute" Bad Gateway response from the server, since we couldn't understand what the actual // response from the server was. set the keep-alive on the substitute response to false so the proxy closes // the connection to the server, since we don't know what state the server thinks the connection is in. FullHttpResponse substituteResponse = ProxyUtils.createFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_GATEWAY, "Unable to parse response from server"); HttpHeaders.setKeepAlive(substituteResponse, false); httpResponse = substituteResponse; } currentFilters.serverToProxyResponseReceiving(); rememberCurrentResponse(httpResponse); respondWith(httpResponse); if (ProxyUtils.isChunked(httpResponse)) { return AWAITING_CHUNK; } else { currentFilters.serverToProxyResponseReceived(); return AWAITING_INITIAL; } }
@Override protected ConnectionState readHTTPInitial(HttpResponse httpResponse) { LOG.debug("Received raw response: {}", httpResponse); if (httpResponse.decoderResult().isFailure()) { LOG.debug("Could not parse response from server. Decoder result: {}", httpResponse.decoderResult().toString()); // create a "substitute" Bad Gateway response from the server, since we couldn't understand what the actual // response from the server was. set the keep-alive on the substitute response to false so the proxy closes // the connection to the server, since we don't know what state the server thinks the connection is in. FullHttpResponse substituteResponse = ProxyUtils.createFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_GATEWAY, "Unable to parse response from server"); HttpUtil.setKeepAlive(substituteResponse, false); httpResponse = substituteResponse; } currentFilters.serverToProxyResponseReceiving(); rememberCurrentResponse(httpResponse); respondWith(httpResponse); if (ProxyUtils.isChunked(httpResponse)) { return AWAITING_CHUNK; } else { currentFilters.serverToProxyResponseReceived(); return AWAITING_INITIAL; } }