From 91e00e52892f884395cfb1654fb836c9ee50eb8a Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Tue, 20 Sep 2011 09:58:53 -0700 Subject: [PATCH] return octet stream for unmatched extensions, instead of nil --- lib/middleman/base.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/middleman/base.rb b/lib/middleman/base.rb index 5c1b15dd..f7911842 100644 --- a/lib/middleman/base.rb +++ b/lib/middleman/base.rb @@ -99,7 +99,9 @@ module Middleman::Base # Return static files if !::Tilt.mappings.has_key?(template_engine.to_s) - content_type mime_type(File.extname(request_path)), :charset => 'utf-8' + matched_mime = mime_type(File.extname(request_path)) + matched_mime = "application/octet-stream" if matched_mime.nil? + content_type matched_mime, :charset => 'utf-8' status 200 send_file File.join(settings.views, request_path) false