Invalid character found in the request target in spring boot

后端 未结 6 703
自闭症患者
自闭症患者 2020-12-09 08:27

My application is started with java -jar with version 1.5.6.RELEASE of spring boot.
The content of one of my request has the character \"{\".When it is sended to serve

6条回答
  •  感情败类
    2020-12-09 09:03

    you will start your Spring boot app like this

    $ java -jar -Dtomcat.util.http.parser.HttpParser.requestTargetAllow=|{}
     demo-0.0.1-SNAPSHOT.jar
    

    or encode uri like this

    document.location = restUrl + "/print?reportParams= " + encodeURI(JSON.stringify(jsonData));
    

提交回复
热议问题