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

Add more default mime types #764

Closed
nojaf opened this issue Jun 8, 2022 · 1 comment
Closed

Add more default mime types #764

nojaf opened this issue Jun 8, 2022 · 1 comment

Comments

@nojaf
Copy link

nojaf commented Jun 8, 2022

Hello,

Comparing the default mime types of Suave

let defaultMimeTypesMap = function
| ".bmp" -> createMimeType "image/bmp" false
| ".css" -> createMimeType "text/css" true
| ".gif" -> createMimeType "image/gif" false
| ".png" -> createMimeType "image/png" false
| ".svg" -> createMimeType "image/svg+xml" true
| ".ico" -> createMimeType "image/x-icon" false
| ".xml" -> createMimeType "application/xml" true
| ".js" -> createMimeType "application/javascript" true
| ".json" -> createMimeType "application/json" true
| ".map" -> createMimeType "application/json" true
| ".htm"
| ".html" -> createMimeType "text/html" true
| ".jpe"
| ".jpeg"
| ".jpg" -> createMimeType "image/jpeg" false
| ".exe" -> createMimeType "application/exe" false
| ".pdf" -> createMimeType "application/pdf" false
| ".txt" -> createMimeType "text/plain" true
| ".ttf" -> createMimeType "application/x-font-ttf" true
| ".otf" -> createMimeType "application/font-sfnt" true
| ".woff" -> createMimeType "application/font-woff" false
| ".woff2" -> createMimeType "application/font-woff2" false
| ".eot" -> createMimeType "application/vnd.ms-fontobject" false
| _ -> None

to the list of ASP.NET Core

https://github.com/dotnet/aspnetcore/blob/86e28e7b267579e2999e06b63eeef27e4836384a/src/Middleware/StaticFiles/src/FileExtensionContentTypeProvider.cs#L24-L404

There is quite the delta. Would you be open to having the same list?

@ademar
Copy link
Member

ademar commented Jan 18, 2023

We rather have a minimal number of preconfigured mime types. It is a security feature.

@ademar ademar closed this as completed Jan 18, 2023
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