Spring 5.0.3 RequestRejectedException: The request was rejected because the URL was not normalized

前端 未结 7 556
梦谈多话
梦谈多话 2020-11-27 15:59

Not sure if this is a bug with Spring 5.0.3 or a new feature to fix things on my end.

After the upgrade, I am getting this error. Interestingly this error is only on

相关标签:
7条回答
  • 2020-11-27 16:40

    setAllowUrlEncodedSlash(true) didn't work for me. Still internal method isNormalized return false when having double slash.

    I replaced StrictHttpFirewall with DefaultHttpFirewall by having the following code only:

    @Bean
    public HttpFirewall defaultHttpFirewall() {
        return new DefaultHttpFirewall();
    }
    

    Working well for me.
    Any risk by using DefaultHttpFirewall?

    0 讨论(0)
提交回复
热议问题