/** Called to signal that a bad HTTP message has been received. * @param failure the failure with the bad message information */ public default void badMessage(BadMessageException failure) { badMessage(failure.getCode(), failure.getReason()); }
/** Called to signal that a bad HTTP message has been received. * @param failure the failure with the bad message information */ public default void badMessage(BadMessageException failure) { badMessage(failure.getCode(), failure.getReason()); }
private void minimalErrorResponse(Throwable failure) { try { int code = 500; Integer status=(Integer)_request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE); if (status!=null) code = status.intValue(); else { Throwable cause = unwrap(failure,BadMessageException.class); if (cause instanceof BadMessageException) code = ((BadMessageException)cause).getCode(); } _response.reset(true); _response.setStatus(code); _response.flushBuffer(); } catch (Throwable x) { if (x != failure) failure.addSuppressed(x); abort(failure); } }
@Override public void badMessage(BadMessageException failure) { HttpExchange exchange = getHttpExchange(); if (exchange != null) { HttpResponse response = exchange.getResponse(); response.status(failure.getCode()).reason(failure.getReason()); failAndClose(new HttpResponseException("HTTP protocol violation: bad response on " + getHttpConnection(), response, failure)); } }
code = bme.getCode(); reason = bme.getReason();
LOG.warn("bad HTTP parsed: "+e._code+(e.getReason()!=null?" "+e.getReason():"")+" for "+_handler); setState(State.CLOSE); _handler.badMessage(e.getCode(), e.getReason());
_response.sendError(bme.getCode(), bme.getReason());
public void onBadMessage(BadMessageException failure) int status = failure.getCode(); String reason = failure.getReason(); if (status < 400 || status > 599)