[Solved] Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors wi…

Error parsing HTTP request header

Recently, an error was reported when doing a spring MVC project. The error is as follows:

Information: error parsing HTTP request header
note: further occurrences of HTTP header parsing errors will be logged at debug level

It’s very depressing to display the wrong HTTP request header. This problem occurred before because the submitted data exceeded the defined header content

At that time, the maxhttpheadersize of server.xml in Tomcat had been set large enough. Why did the problem still occur

Later, I found out the problem. It turned out that the JSON transmission included {}, which is the reason. Because after a certain version of tomcat7

A new feature is added, that is, access resolution is strictly in accordance with RFC 3986 specification, which defines the

Only English letters (a-za-z), numbers (0-9), – ﹣ are allowed~ 4 special characters

And all reserved characters (rfc3986 specifies the following characters as reserved characters:! * ‘();: @& amp; = + $ ,/?# [ ])。

The solution is actually very simple. You can change the last line of Catalina. Properties of Tomcat to

tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}

Allow {}

Similar Posts: