-
Notifications
You must be signed in to change notification settings - Fork 10.4k
FileExtensionContentTypeProvider #1425
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
Comments
What examples did you have in mind? |
File uploads and detect content-type. (not particular involved in serving them) A middleware that does something based on content type, for example a middleware FileServer-like on a subset of content-types(images) that Resize based on request query string/params An app that copy files from storage services (like azure blog storage). So you can use the FECTP to save the correct content type. If tomorrow, a ByteHeaderContentTypeProvider is created and used on other middleware, like the FileUploadSafeBlockerMiddleware, does it make sense to make it on that middleware? I don't know, content-type mapping is way separate from a static files middleware from my pov. It doesn't feel (gut-feeling) like a good place. I just wanted to let you know, maybe it IS the right thing. |
Those are some interesting ideas, but none of them are on our roadmap. There's also no obvious alternative home for it right now. We can move it later and type-redirect if we need to. |
I would think the obvious home to be aspnet/FileSystem. I can certainly see the value of having this type available outside of StaticFiles. |
FileSystem doesn't know anything about mime-types, or HTTP for that matter. |
@Tratcher isn't usefull that FileSystem knows about mime-types? just asking. |
Mime types are a HTTP concept (more or less), where Microsoft.Extensions.FileProviders is a much lower level component that operates independent of the HTTP stack. |
I think aspnet/HttpAbstractions would be a good place since it is more global HTTP concern. |
This issue is being closed because it has not been updated in 3 months. We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate. |
Uh oh!
There was an error while loading. Please reload this page.
It feels weird that the FileExtensionContentTypeProvider is on the StaticFiles middleware.
Shouldn't be somewhere more accesible ?
I think there are multiple situations where one may want to work with that provider outside of static files.
Just a thought.
The text was updated successfully, but these errors were encountered: