In Bezug [https://stackoverflow.com/questions/797 ... on-android]] -A1] Derzeit habe ich einen Mac zum Debuggen verwendet und festgestellt, dass ein Fehler wie gezeigt berichtet. Kann mir jemand helfen, ich kann diesen Fehler nicht beheben, obwohl ich den folgenden Code hinzugefügt habe: < /p>
Code: Select all
@Configuration
public class MimeTypeConfig {
@Bean
public WebServerFactoryCustomizer webServerFactoryCustomizer() {
return factory -> {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
mappings.add("css", "text/css");
mappings.add("js", "application/javascript");
factory.setMimeMappings(mappings);
};
}
}
< /code>
und < /p>
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/assets/**")
.addResourceLocations("classpath:/static/assets/")
.setCachePeriod(3600)
.resourceChain(true)
.addResolver(new PathResourceResolver());
}
}
< /code>
Und dies ist das Konsolenprotokoll: < /p>
Did not parse stylesheet at 'https://grossly-organic-haddock.ngrok-free.app/assets/css/style.css' because non CSS MIME types are not allowed in strict mode.
Did not parse stylesheet at 'https://grossly-organic-haddock.ngrok-free.app/assets/css/custom-bootstrap.css' because non CSS MIME types are not allowed in strict mode.
Did not parse stylesheet at 'https://grossly-organic-haddock.ngrok-free.app/assets/css/style-bootstrap.css' because non CSS MIME types are not allowed in strict mode.
Did not parse stylesheet at 'https://grossly-organic-haddock.ngrok-free.app/assets/css/extra/s2013_style.css?date=TIMESTAMP' because non CSS MIME types are not allowed in strict mode.
Refused to execute 'https://grossly-organic-haddock.ngrok-free.app/assets/js/api.js?date=TIMESTAMP' as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.
Refused to execute 'https://grossly-organic-haddock.ngrok-free.app/assets/js/common.js?date=TIMESTAMP' as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.
Refused to execute 'https://grossly-organic-haddock.ngrok-free.app/assets/js/constant.js?date=TIMESTAMP' as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.
Refused to execute 'https://grossly-organic-haddock.ngrok-free.app/assets/js/common_validate.js?date=TIMESTAMP' as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.
Refused to execute 'https://grossly-organic-haddock.ngrok-free.app/assets/js/extra/s2013.js?date=TIMESTAMP' as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.