The Ultimate Solution: Invalid character found in the request target.

The ultimate solution :( export potential)

My tomcat version is 8.5.32, encounter the following error when exporting.

Error log :

Invalid character found in the request target. The valid characters are defined in RFC 3986

Seen from the error log for the request URL characters have been restricted.

Solution :

1. In the installation path tomcat conf / catalina.properties last addition of 2 lines:

tomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

There are also online self-deceiving practices , it is to reduce the version of tomcat . After Tomcat 8.5 version, http resolve when done strictly limited.

requestTargetAllow can configure |, {,} these three characters, for others (such as "<> [\] ^` {|}.), is still being given, if the | other characters beyond {}, then also requires the following configuration.

2. conf / server.xml in <Connector> node, add two properties (composition may receive any special characters, self-configuration):

relaxedPathChars="|{}[],\"
relaxedQueryChars="|{}[],\"

Guess you like

Origin www.cnblogs.com/stromgao/p/12067518.html