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

Wrong MIME type when converting asset #200

Open
renaatdemuynck opened this issue Nov 3, 2016 · 2 comments
Open

Wrong MIME type when converting asset #200

renaatdemuynck opened this issue Nov 3, 2016 · 2 comments

Comments

@renaatdemuynck
Copy link

I am working on a filter that converts fonts to different formats (e.g. when I request 'myfont.woff' it will convert it on-the-fly from 'MyFont.OTF'). The problem is that the MIME type will be application/x-font-opentype instead of application/woff. I've tried setting the mime type of the asset inside the filter but it is being overwritten later by one of the resolvers. So I thought "How does the MimeResolver do this for LESS assets?". Apparently this works as expected for LESS files because the mime type for LESS is text/css (which technically isn't correct) (The same goes for SASS and CoffeScript too). The problem seems to be that the MIME type is being determined based on the source asset and not on the extension of the requested asset. Simply changing the behavior of determining the MIME type would break BC. So how and where could this be fixed? (Or am I missing something here?)

@RWOverdijk
Copy link
Owner

@renaatdemuynck I agree that it should use the mime type of the requested asset.

It might also miss some mappings (I didn't check yet). I'm personally down with a BC-break for this, as it's invalid behavior.

@renaatdemuynck
Copy link
Author

Ok, I will fix this and create a pull request

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

2 participants