Conform to the rack specs, with help from Rack::Lint
This commit is contained in:
parent
c2d816fb02
commit
ae743ac4db
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue