[Spring boot] Refused to execute script from 'http://localhost:~~~' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
730 ワード
スプリングの安全構成を設定してテストしようとしたところ、タイトルと同じエラーが発生しました.
Refused to execute script from ' http://localhost:8000/auth/login ' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
開発者ツール->ネットワーク
アクションをクリックすると、jsからControllerに移動する必要があります.
jsはSpring Security Configにjsアクセス権を設定しません.
ログインページのロードを続けてみます.
1.join : 200
2.user.js : 302 error
3.login : 200
何か漏れたのかと思ったら、permitAllにJoin完了後にアクセスしたインデックス(ルートパス)を追加しませんでした.
Refused to execute script from ' http://localhost:8000/auth/login ' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
開発者ツール->ネットワーク
アクションをクリックすると、jsからControllerに移動する必要があります.
jsはSpring Security Configにjsアクセス権を設定しません.
ログインページのロードを続けてみます.
1.join : 200
2.user.js : 302 error
3.login : 200
何か漏れたのかと思ったら、permitAllにJoin完了後にアクセスしたインデックス(ルートパス)を追加しませんでした.
http
.authorizeHttpRequests()
.antMatchers("/", "/auth/**") // "/" 추가
.permitAll()
Reference
この問題について([Spring boot] Refused to execute script from 'http://localhost:~~~' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.), 我々は、より多くの情報をここで見つけました https://velog.io/@ujone/Spring-boot-Refused-to-execute-script-from-httplocalhost-because-its-MIME-type-texthtml-is-not-executable-and-strict-MIME-type-checking-is-enabledテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol