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:
parent
bca04841fe
commit
81a77828bd
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue