aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Lopez <seniorlopez@gmail.com>2012-12-19 15:47:48 -0800
committerBrian Lopez <seniorlopez@gmail.com>2012-12-19 15:47:48 -0800
commitd1537062c7333e280533b31ae942577ddef96219 (patch)
treeb683d90d0ad3d8dfe1a90307de7c743427718b9f
parent2696a9c5e720ad43d1f3e503a2dd4602098dc09d (diff)
make sure we set content-type for non-binary types as wellcontent-type-fix
-rw-r--r--lib/linguist/blob_helper.rb7
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