protected long getContentLength ( HttpServletRequest request ) { if ( useServlet31 ) { return request . getContentLengthLong ( ) ; } String contentLengthHeader = request . getHeader ( HttpHeaders . CONTENT_LENGTH ) ; if ( contentLengthHeader != null ) { try { return Long . parseLong ( contentLengthHeader ) ; } catch ( NumberFormatException e ) { } } return request . getContentLength ( ) ; }
Get the header value as a long in order to more correctly proxy very large requests