如何防止应用程序出现此类错误:
Refused to execute script from 'http://localhost:8091/inline.f65dd8c6e3cb256986d2.bundle.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
这是一个
Spring Boot
Angular 4
当我运行第一页时,它会抛出这些错误。
errors
我认为这可能与
Spring Security
因为当我添加:
.and().formLogin().loginPage("/")
.loginProcessingUrl("/").permitAll();
它开始抛出错误,但我真的需要这段代码。整个方法看起来:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().authorizeRequests()
.antMatchers("/resources/static/**/*", "/", "/api/auth").permitAll()
.anyRequest().authenticated()
.and().formLogin().loginPage("/")
.loginProcessingUrl("/").permitAll();
}