only forward if response is not committed.

This commit is contained in:
Spencer Gibb
2015-01-08 14:52:27 -07:00
parent 95541e0102
commit 3d91dae0c4

View File

@@ -50,7 +50,9 @@ public class SendErrorFilter extends ZuulFilter {
RequestDispatcher dispatcher = ctx.getRequest().getRequestDispatcher(errorPath);
if (dispatcher != null) {
ctx.set(SEND_ERROR_FILTER_RAN, true);
dispatcher.forward(ctx.getRequest(), ctx.getResponse());
if (!ctx.getResponse().isCommitted()) {
dispatcher.forward(ctx.getRequest(), ctx.getResponse());
}
}
} catch (Exception e) {
Throwables.propagate(e);