| Class | ActionController::AbstractRequest |
| In: |
lib/123.rb
lib/reverse_proxy_fix.rb |
| Parent: | Object |
Need to modify the request slightly
| request_uri | -> | old_request_uri |
Request_uri usually returns the path relative to the root of the application. However, if you try to do redirect_to(request_uri) then you may get unexpected results. This method overwrites request_uri to always include the full front-facing path. This also breaks route recognition, so this is addressed in ActionController::Routing::RouteSet::recognize_path
# File lib/123.rb, line 58
58: def request_uri
59: uri = old_request_uri
60: if ActionController::check_mode_and_base
61: uri = BASE_URL + uri unless uri.include?(BASE_URL)
62: end
63: uri
64: end
Request_uri usually returns the path relative to the root of the application. However, if you try to do redirect_to(request_uri) then you may get unexpected results. This method overwrites request_uri to always include the full front-facing path. This also breaks route recognition, so this is addressed in ActionController::Routing::RouteSet::recognize_path
# File lib/reverse_proxy_fix.rb, line 58
58: def request_uri
59: uri = old_request_uri
60: if ActionController::check_mode_and_base
61: uri = BASE_URL + uri unless uri.include?(BASE_URL)
62: end
63: uri
64: end