Class | Rack::ForwardRequest |
In: |
lib/rack/recursive.rb
|
Parent: | Exception |
Rack::ForwardRequest gets caught by Rack::Recursive and redirects the current request to the app at url.
raise ForwardRequest.new("/not-found")
env | [R] | |
url | [R] |
# File lib/rack/recursive.rb, line 13 13: def initialize(url, env={}) 14: @url = URI(url) 15: @env = env 16: 17: @env["PATH_INFO"] = @url.path 18: @env["QUERY_STRING"] = @url.query if @url.query 19: @env["HTTP_HOST"] = @url.host if @url.host 20: @env["HTTP_PORT"] = @url.port if @url.port 21: @env["rack.url_scheme"] = @url.scheme if @url.scheme 22: 23: super "forwarding to #{url}" 24: end