써먹는 웹개발

[SpringBoot] Whitelabel Error Page > the request was rejected because the url contained a potentially malicious string ";" 해결방법 본문

Server/Spring Boot

[SpringBoot] Whitelabel Error Page > the request was rejected because the url contained a potentially malicious string ";" 해결방법

kmhan 2022. 12. 26. 14:29


728x90
반응형

Spring Boot 에러 Whitelabel Error Page

the request was rejected because the url contained a potentially malicious string ";" 해결방법입니다.

 

WebSecurityConfigurerAdapter를 상속받은 파일에 16~24번줄 소스 추가

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// ...
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.web.firewall.DefaultHttpFirewall;
import org.springframework.security.web.firewall.HttpFirewall;
 
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        // ...
    }
    // ...
 
    // 아래 내용 추가
    @Override    
    public void configure(WebSecurity web) throws Exception {
        web.httpFirewall(defaultHttpFirewall());
    }
 
    @Bean
    public HttpFirewall defaultHttpFirewall() {
        return new DefaultHttpFirewall();
    }
}
cs
728x90
반응형


Comments