Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing

There is no error reported after the spirngboot project is started, but when testing the interface with postman, it is found that there will be intermittent (one good and one bad) errors

Error parsing HTTP request header
 Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException : Invalid character found in method name. HTTP method names must be tokens

Simple appearance is also very normal, it is a success, a mistake, make me at a loss.

Looking up the online materials, 98% of them said that the configuration change of the maximum header value of Tomcat would be good, but springboot is built-in Tomcat,

The method of modification is as follows: sever.tomcat.max -http-header-size=8192

But this configuration has been abandoned by the boot project of higher version,

It can be changed to: sever.max -http-header-size=8192

Full of joy, thought that good, and then found No.

The other 2% said it might be related to the HTTPS protocol, so it could be changed to http.

But I started it locally. It’s always http.

After struggling for a long time, I found that the culprit actually added content length to the header when requesting and gave it a fixed value, so I would report an error. Stupid cry~~

As for the function of modifying the max HTTP header size, I set this to 1 and request again to find that the error reported is not the same as my previous one, but:

Error processing request
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.

Read More: