use of org.springframework.cloud.netflix.zuul.util.ZuulRuntimeException in project spring-cloud-netflix by spring-cloud.
the class RibbonRoutingFilter method run.
@Override
public Object run() {
RequestContext context = RequestContext.getCurrentContext();
this.helper.addIgnoredHeaders();
try {
RibbonCommandContext commandContext = buildCommandContext(context);
ClientHttpResponse response = forward(commandContext);
setResponse(response);
return response;
} catch (ZuulException ex) {
throw new ZuulRuntimeException(ex);
} catch (Exception ex) {
throw new ZuulRuntimeException(ex);
}
}
use of org.springframework.cloud.netflix.zuul.util.ZuulRuntimeException in project spring-cloud-netflix by spring-cloud.
the class SimpleHostRoutingFilter method run.
@Override
public Object run() {
RequestContext context = RequestContext.getCurrentContext();
HttpServletRequest request = context.getRequest();
MultiValueMap<String, String> headers = this.helper.buildZuulRequestHeaders(request);
MultiValueMap<String, String> params = this.helper.buildZuulRequestQueryParams(request);
String verb = getVerb(request);
InputStream requestEntity = getRequestBody(request);
if (request.getContentLength() < 0) {
context.setChunkedRequestBody();
}
String uri = this.helper.buildZuulRequestURI(request);
this.helper.addIgnoredHeaders();
try {
CloseableHttpResponse response = forward(this.httpClient, verb, uri, request, headers, params, requestEntity);
setResponse(response);
} catch (Exception ex) {
throw new ZuulRuntimeException(ex);
}
return null;
}
Aggregations