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.

2024. 3. 21. 09:17·개발/spring boot
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
'개발/spring boot' 카테고리의 다른 글
  • spring security formLogin 구현
  • 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
  • spring boot 이미지 경로 설정 방법 WebMvcConfigurer 사용
  • spring boot 2.0.2 → spring 2.4.4 로 업그레이드
nix-be
nix-be
  • nix-be
    NiX
    nix-be
  • 전체
    오늘
    어제
    • 홈
      • 책
        • 오브젝트
      • 성장
        • jpa Querydsl 정리
        • 코딩테스트
      • 인프라
        • linux
        • vmware
        • CI&CD
        • 네트워크
        • docker
      • 개발
        • spring boot
        • JPA
        • java
        • thymeleaf
        • 이슈
        • jquery
        • javascript
        • 안드로이드
      • DB
        • postgreSql
      • 잡다한것
        • 프로그램
        • 일상 관련
      • 회사
        • 티
  • 블로그 메뉴

    • 홈
    • 개발
  • 링크

  • 공지사항

  • 인기 글

  • 태그

  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
nix-be
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.
상단으로

티스토리툴바