访问某个请求报错:
org.springframework.security.web.firewall.RequestRejectedException: The request was rejected because the URL contained a potentially malicious String ";"
这是因为使用了SpringSecurity,其中有个防火墙:org.springframework.security.web.firewall.StrictHttpFirewall
阻止了分号的使用。一般是jessionid出现在了路径中造成的。
解决办法如下:
如果想继续让分号出现在URL路径中,需要放开安全防火墙中对分号的限制
@Bean
public HttpFirewall allowUrlSemicolonHttpFirewall() {
StrictHttpFirewall firewall = new StrictHttpFirewall();
firewall.setAllowSemicolon(true);
return firewall;
}