You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#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.
The text was updated successfully, but these errors were encountered:
I can understand this might make the content-type more accurate. But based on usage it seems like existing implementation is sufficient.
Do you have any requirement which is not full-filled by the existing implementation? If you could provide, this might help in understanding the use-case and accordingly help in prioritizing this.
#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.The text was updated successfully, but these errors were encountered: