Skip to content

Content type from file, not from extension #1839

@mbrevda

Description

@mbrevda

#155 introduced automatically setting contentType based on the file suffix. I was wondering about this design: wouldn't it be more accurate to check the file contents by, say, checking the checking the magic numbers signature and only falling back to go's (arguably quite limited) list of extensions if a proper mime type cannot be found?

Here is an example of a golang lib with quite an extensive list of files detected. The ubiquitous file command might be helpful, too.

Metadata

Metadata

Assignees

Labels

feature requestFeature request: request to add new features or functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions