近期几天,开发接口时。tomcat报了400错误,查了下原因。

错误原因:url中參数部分包括/,默认tomcat是不支持url參数包括: /(%2F),\(%5C)。

解析方法:能够通过加入配置Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

方法1:改动配置文件,tomcat6/conf/catalina.properties文件加入一行Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

方法2:加入启动參数,-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true


只是从apache官网上看,这个配置项属于Security组,不知开启后会有怎么样的风险?有知道的前辈请不吝赐教~
官方说明:  http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html#Security

相关文章:

  • 2022-02-02
  • 2021-08-11
  • 2021-11-19
  • 2021-04-01
猜你喜欢
  • 2021-05-05
  • 2021-11-27
  • 2021-12-14
  • 2021-12-13
  • 2021-08-19
  • 2021-11-08
  • 2021-06-16
相关资源
相似解决方案