diff options
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 3e2344c3cb..2e7957caf9 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -3,7 +3,8 @@ module ActionController class AbstractRequest # Returns both GET and POST parameters in a single hash. def parameters - @parameters ||= request_parameters.update(query_parameters) + # puts "#{request_parameters.inspect} | #{query_parameters.inspect} | #{path_parameters.inspect}" + @parameters ||= request_parameters.merge(query_parameters).merge(path_parameters).with_indifferent_access end def method @@ -73,7 +74,7 @@ module ActionController end def request_uri - env['REQUEST_URI'] + (%r{^\w+\://[^/]+(/.*|$)$} =~ env['REQUEST_URI']) ? $1 : env['REQUEST_URI'] # Remove domain, which webrick puts into the request_uri. end def protocol @@ -85,7 +86,7 @@ module ActionController end def path - request_uri ? request_uri.split('?').first : '' + path = request_uri ? request_uri.split('?').first : '' end def port @@ -100,7 +101,16 @@ module ActionController def host_with_port env['HTTP_HOST'] || host + port_string end + + def path_parameters=(parameters) + @path_parameters = parameters + @parameters = nil + end + def path_parameters + @path_parameters ||= {} + end + #-- # Must be implemented in the concrete request #++ |