How to set max-http-header-size in spring boot 2.x application

From Spring boot 2.1, you will now need to use a DataSize parsable value. e.g.

server.max-http-header-size=40KB

In spring boot 1.3.5.RELEASE what worked for me is setting the following entry in application.properties:

server.tomcat.max-http-header-size=100000

Please try server.max-http-header-size. I have found it here: Common application properties.

The default value for Tomcat and Jetty is 8KB and for Undertow is 1MB.


You should set on the "application.properties" file:

server.max-http-header-size=48000

48000 is an example of an excessive header, put whatever you want.