Conform to the rack specs, with help from Rack::Lint

This commit is contained in:
Ben Hollis 2012-10-13 13:12:21 -07:00 committed by Thomas Reynolds
parent c2d816fb02
commit ae743ac4db
2 changed files with 4 additions and 1 deletions

View file

@ -1,6 +1,7 @@
# Built on Rack
require "rack"
require "rack/file"
require "rack/lint"
module Middleman
module CoreExtensions
@ -75,6 +76,8 @@ module Middleman
def to_rack_app(&block)
inner_app = inst(&block)
app.use Rack::Lint
(@middleware || []).each do |m|
app.use(m[0], *m[1], &m[2])
end

View file

@ -66,7 +66,7 @@ module Middleman
status, headers, response = @rack_app.call(env)
# We don't want to use this middleware when rendering files to figure out their hash!
return [status, headers, response] if env["bypass_asset_hash"]
return [status, headers, response] if env["bypass_asset_hash"] == 'true'
path = @middleman_app.full_path(env["PATH_INFO"])
dirpath = Pathname.new(File.dirname(path))