minor tweaks

This commit is contained in:
tdreyno 2009-10-16 09:54:43 -07:00
parent 16b8ba89a8
commit 216ebed109
2 changed files with 3 additions and 2 deletions

View file

@ -36,7 +36,7 @@ module Middleman
# Rack helper for adding mime-types during local preview # Rack helper for adding mime-types during local preview
def self.mime(ext, type) def self.mime(ext, type)
ext = ".#{ext}" unless ext.to_s[0] == ?. ext = ".#{ext}" unless ext.to_s[0] == ?.
Rack::Mime::MIME_TYPES[ext.to_s] = type ::Rack::Mime::MIME_TYPES[ext.to_s] = type
end end
# Convenience function to discover if a tempalte exists for the requested renderer (haml, sass, etc) # Convenience function to discover if a tempalte exists for the requested renderer (haml, sass, etc)

View file

@ -9,7 +9,8 @@ module Middleman
def call(env) def call(env)
path = env["PATH_INFO"] path = env["PATH_INFO"]
if path.include?("favicon.ico") || File.exists?(File.join(Middleman::Base.public, path)) file_path = File.join(Middleman::Base.public, path)
if path.include?("favicon.ico") || (File.exists?(file_path) && !File.directory?(file_path))
@file_server.call(env) @file_server.call(env)
else else
@app.call(env) @app.call(env)