报400错误 解决The valid characters are defined in RFC 7230 and RFC 3986

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jianghuiyun/article/details/81909842

开发中突然就遇到这个问题了,困扰了整个下午,在网上查找试了各种方法后还是不行,最后在google论坛里找到了此方法,得以解决,甚是欣慰,写本文以记录。

项目运行环境:apache-tomcat-8.5.31;

get请求参数:ids[]=1;

前端报400错误;

问题截图如下:

解决方法论坛文章连接:

https://groups.google.com/a/opendap.org/forum/#!topic/support/ixTqhDXoLZQ

原文截图:

在Tomcat配置文件中:$ CATALINA_HOME / conf / server.xml将以下属性添加到Connector元素:

relaxedQueryChars = “<> [\] {|}” 
所以你最终得到的结果如下: 
<Connector port =“8080”protocol =“HTTP / 1.1” 
               connectionTimeout = “20000” 
               redirectPort = “8443” 
               relaxedQueryChars = “&LT;&GT; [\] {|}” 
               /> 

经验证此方式可行。

猜你喜欢

转载自blog.csdn.net/jianghuiyun/article/details/81909842
今日推荐