728x90
1. 이슈 사항
웹 개발자 도구 console 이슈 내용
Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
2. 원인
spring security 를 사용하면서 resources/static 폴더를 못 읽는 경우가 발생
3. 해결
아래 ignoring() 를 사용하여 해결하였습니다.
@EnableWebSecurity
@Configuration
@RequiredArgsConstructor
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/css/**", "/js/**", "/images/**", "/sb-admin/**", "/bootstrap/**", "/icons/**");
}
}
728x90
'개발 > spring boot' 카테고리의 다른 글
spring security formLogin 구현 (0) | 2024.03.26 |
---|---|
Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). The current version is Gradle 4.5.1 (0) | 2024.03.21 |
spring boot 이미지 경로 설정 방법 WebMvcConfigurer 사용 (0) | 2024.03.11 |
spring boot 2.0.2 → spring 2.4.4 로 업그레이드 (0) | 2024.01.07 |
Preconditions 사용 할 때 그래들 설정 (0) | 2023.04.20 |