1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Make rack request object available in template rendering. Closes #1532

This commit is contained in:
Thomas Reynolds 2015-06-01 11:12:34 -07:00
parent bca04841fe
commit 81a77828bd

View file

@ -73,8 +73,9 @@ module Middleman
# message.
#
# @param env
# @param [Rack::Request] req
# @param [Rack::Response] res
def process_request(env, _, res)
def process_request(env, req, res)
start_time = Time.now
request_path = URI.decode(env['PATH_INFO'].dup)
@ -100,7 +101,7 @@ module Middleman
begin
# Write out the contents of the page
res.write resource.render
res.write resource.render({}, { rack: { request: req } })
# Valid content is a 200 status
res.status = 200