aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/lib/rails/application.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index ff6c905f3e..ad6ec1264d 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -159,8 +159,9 @@ module Rails
# Implements call according to the Rack API. It simply
# dispatches the request to the underlying middleware stack.
def call(env)
- env["ORIGINAL_FULLPATH"] = build_original_fullpath(env)
- env["ORIGINAL_SCRIPT_NAME"] = env["SCRIPT_NAME"]
+ req = ActionDispatch::Request.new env
+ env["ORIGINAL_FULLPATH"] = req.fullpath
+ env["ORIGINAL_SCRIPT_NAME"] = req.script_name
super(env)
end
@@ -505,15 +506,8 @@ module Rails
end
def build_original_fullpath(env) #:nodoc:
- path_info = env["PATH_INFO"]
- query_string = env["QUERY_STRING"]
- script_name = env["SCRIPT_NAME"]
-
- if query_string.present?
- "#{script_name}#{path_info}?#{query_string}"
- else
- "#{script_name}#{path_info}"
- end
+ req = ActionDispatch::Request.new env
+ env["ORIGINAL_FULLPATH"] = req.fullpath
end
def validate_secret_key_config! #:nodoc: