-
Bug
-
Resolution: Done
-
Critical
-
3.9.1.Final
-
None
When receiving a (multipart-formdata POST) request with the content-length header value set with a whitespace before the actual length-value RESTEasy throws the below exception and fails to process the request.
As stated in RFC7230 (https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.3) whitespaces are valid and should thus be correctly processed (trimmed).
java.lang.NumberFormatException: For input string: " 896" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:578) at java.lang.Long.parseLong(Long.java:631) at org.jboss.resteasy.util.NoContent.isContentLengthZero(NoContent.java:32) at org.jboss.resteasy.plugins.providers.StringTextStar.readFrom(StringTextStar.java:41) at org.jboss.resteasy.plugins.providers.StringTextStar.readFrom(StringTextStar.java:24) at org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl$PartImpl.getBody(MultipartInputImpl.java:344) at org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl$PartImpl.getBodyAsString(MultipartInputImpl.java:39)