diff options
| -rw-r--r-- | lib/linguist/blob_helper.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index d7f56de..ead64a5 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -69,8 +69,11 @@ module Linguist # # Returns a content type String. def content_type - @content_type ||= (binary_mime_type? || binary?) ? mime_type : - (encoding ? "text/plain; charset=#{encoding.downcase}" : "text/plain") + return @content_type if defined? @content_type + + @content_type = mime_type ? mime_type : "text/plain" + @content_type << "; charset=#{encoding.downcase}" + @content_type end # Public: Get the Content-Disposition header value |
