반응형
프로젝트 진행 중 잘 출력되던 이미지가 엑박으로 출력되는 오류가 발생했다
관련해서 찾아보니, 이미지 폴더에 대해 Spring Security 처리를 해주지 않아 발생한 문제였다.
OAuth 로그인 기능을 추가하며 홈 화면 이외의 경로에 대해 보안 처리하도록 설정이 되어있었는데, 이미지 폴더는 보지 않도록 처리해주었다.
이미지 폴더 경로는 /src/main/resources/static/images/** 이다.
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/", "/index", "/login/**", "/images/**").permitAll()
.anyRequest().authenticated();
}
reference : https://recordsoflife.tistory.com/185
반응형
'Spring' 카테고리의 다른 글
[Spring] Mysql 연동 시 application.yml 이슈 (0) | 2023.05.15 |
---|---|
[Spring] MVC pattern & Front controller (0) | 2023.05.13 |
[Spring] Spring Boot + Spring Security OAuth2 Client + Kakao Login - 2 (0) | 2022.03.09 |
[Spring] Spring Boot + Spring Security OAuth2 Client + Kakao Login - 1 (0) | 2022.03.05 |
[Spring] Spring 이란? (0) | 2021.08.29 |