Closed HunteRoi closed 3 years ago
Both are good ideas. When I find time I'll implement, or you're welcome to submit a PR in the interim.
GetMimeType
exists already so it would be refactored to accept either an extension or a filename and check both.
TryGetMimeType
is obviously new and should support the same filename/extension semantics of GetMimeType
without duplicating any code (GetMimeType
can use TryGetMimeType
internally).
Good afternoon!
I came across your repository while searching for a solution to make sure that the filename of a file matches its content-type.
I was wondering if it would be possible to implement
TryGetMimeType
&GetMimeType
using your private_mappings
variable.You can find below the possible signature of such methods: