Conform to the rack specs, with help from Rack::Lint
This commit is contained in:
parent
c2d816fb02
commit
ae743ac4db
2 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Built on Rack
|
# Built on Rack
|
||||||
require "rack"
|
require "rack"
|
||||||
require "rack/file"
|
require "rack/file"
|
||||||
|
require "rack/lint"
|
||||||
|
|
||||||
module Middleman
|
module Middleman
|
||||||
module CoreExtensions
|
module CoreExtensions
|
||||||
|
@ -75,6 +76,8 @@ module Middleman
|
||||||
def to_rack_app(&block)
|
def to_rack_app(&block)
|
||||||
inner_app = inst(&block)
|
inner_app = inst(&block)
|
||||||
|
|
||||||
|
app.use Rack::Lint
|
||||||
|
|
||||||
(@middleware || []).each do |m|
|
(@middleware || []).each do |m|
|
||||||
app.use(m[0], *m[1], &m[2])
|
app.use(m[0], *m[1], &m[2])
|
||||||
end
|
end
|
||||||
|
|
|
@ -66,7 +66,7 @@ module Middleman
|
||||||
status, headers, response = @rack_app.call(env)
|
status, headers, response = @rack_app.call(env)
|
||||||
|
|
||||||
# We don't want to use this middleware when rendering files to figure out their hash!
|
# 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"])
|
path = @middleman_app.full_path(env["PATH_INFO"])
|
||||||
dirpath = Pathname.new(File.dirname(path))
|
dirpath = Pathname.new(File.dirname(path))
|
||||||
|
|
Loading…
Add table
Reference in a new issue