Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiled files return with wrong mime type #23

Open
SamuelJohnsonMedia opened this issue Mar 21, 2021 · 0 comments
Open

Compiled files return with wrong mime type #23

SamuelJohnsonMedia opened this issue Mar 21, 2021 · 0 comments

Comments

@SamuelJohnsonMedia
Copy link

SamuelJohnsonMedia commented Mar 21, 2021

The compiled SCSS file is returned as text/plain and not text/css; charset=UTF-8 which fails to be imported if you are using strict mime type security headers.

In ConfigureServices I have:

        services.AddWebOptimizer( pipeline =>
        {
          pipeline.AddScssBundle( "/all.css", "site.scss" );
        } );

Chromium console log:

Refused to apply style from 'https://localhost:44332/css/all.css' because its MIME type ('text/plain') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

This is strange as I can see that the pipeline is being set properly:

return pipeline.AddBundle(route, "text/css; charset=UTF-8", sourceFiles)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant