In broader context, we would like to limit the size of a messages a client can send to the server by http post request.
I would like to do this by using http header content-length. So I don't have to read the full body, just check this header, and reject the request, if content-length is too large, also reject if content-lenght is missing (http 411 error code)
So I want to be sure that the actual size of message body is the same as set in content-length of the request.
The question is if Tomcat or Spring MVC (my stack) does a validate if the content-lenght is actually represents the reals size of the message body?
(This should be quite easy to implement it with a filter, just wondering if a servlet container, or spring dispatcher servlet does not do like this out of the box.)