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
Related to the Issue #52609, the MIME-info database contains the regex that is not expanded by TypeByExtension.
Expanding regex is not suitable in all cases, for example 60:application/x-sharedlib:*.so.[0-9]*.
Instead, a new function can be added to the API that should receive a type based on full filename, instead of expanding every possible filename for that extension.
The text was updated successfully, but these errors were encountered:
// TypeByPath returns the MIME type associated with a filename.
// If the name has no associated type, TypeByPath returns "".
func TypeByPath(path string) string
The motivation is that not every pattern in the MIME-info database can be expressed as an extension. In particular, these four entries are a problem:
The video/x-anim and application/x-troff-man entries could be expanded into a reasonable number of extensions (.anim1, .anim2, etc.), but video/mpeg has 1000 possible suffixes (none of which start with a .) and application/x-sharedlib isn't a suffix at all.
Related to the Issue #52609, the MIME-info database contains the regex that is not expanded by
TypeByExtension
.Expanding regex is not suitable in all cases, for example
60:application/x-sharedlib:*.so.[0-9]*
.Instead, a new function can be added to the API that should receive a type based on full filename, instead of expanding every possible filename for that extension.
The text was updated successfully, but these errors were encountered: