mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-18 22:23:07 -03:00
Returns text/plain when mime it's undefined
This commit is contained in:
8
utils.go
8
utils.go
@ -53,8 +53,12 @@ func IsDocumentation(path string) bool {
|
||||
return data.DocumentationMatchers.Match(path)
|
||||
}
|
||||
|
||||
func GetMimeType(file string) string {
|
||||
return data.LanguagesMime[file]
|
||||
func GetMimeType(language string) string {
|
||||
if mime, ok := data.LanguagesMime[language]; ok {
|
||||
return mime
|
||||
}
|
||||
|
||||
return "text/plain"
|
||||
}
|
||||
|
||||
const sniffLen = 8000
|
||||
|
Reference in New Issue
Block a user