aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
diff options
context:
space:
mode:
authorJorge Bejar <jorge@wyeworks.com>2015-07-06 21:33:19 -0300
committerJorge Bejar <jorge@wyeworks.com>2015-12-09 10:53:41 -0300
commit83b4e9073f0852afc065ef398bd3ad9b5a6db29c (patch)
treedc2f2e814f8c6dcf4a1a0768c58c99e6d295d302 /actionpack/lib/action_dispatch/http
parentb79bfaadaf5b5c6d3e458c24184a0e846bd8cf55 (diff)
downloadrails-83b4e9073f0852afc065ef398bd3ad9b5a6db29c.tar.gz
rails-83b4e9073f0852afc065ef398bd3ad9b5a6db29c.tar.bz2
rails-83b4e9073f0852afc065ef398bd3ad9b5a6db29c.zip
Response when error should be formatted properly in Rails API if local request
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r--actionpack/lib/action_dispatch/http/parameters.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb
index 5c20bc53c2..4084d78f49 100644
--- a/actionpack/lib/action_dispatch/http/parameters.rb
+++ b/actionpack/lib/action_dispatch/http/parameters.rb
@@ -69,15 +69,15 @@ module ActionDispatch
def default_path_parameters
if format = format_from_path_extension
- { 'format' => format }
+ { format: format }
else
{}
end
end
def format_from_path_extension
- path = @env['action_dispatch.original_path']
- if match = path.match(/\.(\w+)$/)
+ path = @env['action_dispatch.original_path'] || @env['PATH_INFO']
+ if match = path && path.match(/\.(\w+)$/)
match.captures.first
end
end