What is the goal of maxPostSize for Tomcat HTTP Connector?

According to Tomcat docs:

The maximum size in bytes of POST that will be processed by the FORM container URL analysis of pairs. The limit can be disabled by setting the attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).

But what is an β€œFORM container URL parameter analysis”? Any ideas what the purpose of "maxPostSize" is?

Thanks in advance.

+4
source share
2 answers

Its set limit on which to stop POST parsing. Just in case, any hacker decides to start sending a request with POST data and just send POST data. Tomcat won't just parse POST forever. Having a limit prevents denial of service attacks. (They keep doing this until your maxes server stops responding for any reason)

+4
source

This means that when you have something like:

<form type="post" ...> <input name="something" value="someVal" type="text"/> </form> 

in your HTML, if someVal is larger than 2 MB (for example, a very long string), only the first 2 MB of this data will be available when you execute request.getAttribute("something") in your servlet.

-1
source

Source: https://habr.com/ru/post/1308579/


All Articles