mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Inline mime type lookup into blob helper
This commit is contained in:
@@ -32,7 +32,10 @@ module Linguist
|
||||
#
|
||||
# Returns a mime type String.
|
||||
def mime_type
|
||||
@mime_type ||= Mime.mime_for(extname.to_s)
|
||||
@mime_type ||= begin
|
||||
mime_type = Mime.lookup_mime_type_for(extname.to_s)
|
||||
mime_type ? mime_type.to_s : 'text/plain'
|
||||
end
|
||||
end
|
||||
|
||||
# Public: Get the Content-Type header value
|
||||
|
||||
Reference in New Issue
Block a user