diff --git a/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java b/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java index 3e55f282..c7be071d 100644 --- a/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java +++ b/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java @@ -401,7 +401,8 @@ protected HttpRequest newProxyRequestWithEntity(String method, String proxyReque // Get the header value as a long in order to more correctly proxy very large requests private long getContentLength(HttpServletRequest request) { String contentLengthHeader = request.getHeader("Content-Length"); - if (contentLengthHeader != null) { + // To avoid header with blank value + if (contentLengthHeader != null && contentLengthHeader.trim().length() != 0) { return Long.parseLong(contentLengthHeader); } return -1L;