As stated in the Spring Boot 3 Migration Guide the server.max-http-header-size property has been deprecated. You can use the server.max-http-request-header-size property to set the max http request header size only.
I get the following Exception:
org.apache.coyote.http11.HeadersTooLargeException: An attempt was made to write
more data to the response headers than there was room available in the buffer.
Increase maxHttpHeaderSize on the connector
or write less data into the response headers.
I need to increase the max http response header size in an embedded Tomcat 10. Tomcat 10 supports both the maxHttpHeaderSize and the maxHttpResponseHeaderSize attributes.
How I can set these in spring boot 3.x with a WebServerFactoryCustomizer?
You can create a
WebServerFactoryCustomeras shown in the Spring Boot documentation.For your use case, that would look something like this:
Spring Boot 3.1.0 will introduce a property
server.tomcat.maxHttpResponseHeaderSizeto make this easier to configure.