module Roda::RodaPlugins::Base::RequestMethods
def run(app)
before dispatching to another rack app, so the app still works as
This updates SCRIPT_NAME/PATH_INFO based on the current remaining_path
response.status = 404 # not reached
r.run(proc{[404, {}, []]})
r.run(proc{[403, {}, []]}) unless r['letmein'] == '1'
the processing of the request:
from the rack app as the response for this request. This ends
Call the given rack app with the environment and return the response
def run(app) e = @env path = real_remaining_path sn = "SCRIPT_NAME" pi = "PATH_INFO" script_name = e[sn] path_info = e[pi] begin e[sn] += path_info.chomp(path) e[pi] = path throw :halt, app.call(e) ensure e[sn] = script_name e[pi] = path_info end end