diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 30dfd68c0d5..01a6b7655d2 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -1027,12 +1027,11 @@ public class Request implements HttpServletRequest try { if (_connection != null) - _connection._generator.sendError(HttpStatus.BAD_REQUEST_400,"Port couldn't be parsed from Host header: " + hostPort,null, - true); + _connection._generator.sendError(HttpStatus.BAD_REQUEST_400,"Bad Host header",null,true); } catch (IOException e1) { - throw new IllegalArgumentException("IOException caught while trying to send error due to invalid host header: " + hostPort,e1); + throw new RuntimeException(e1); } } return _serverName;