diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-06-18 07:25:25 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-06-25 12:34:36 +0900 |
commit | e130ce456290f1efd39118419ca0783da0677ff1 (patch) | |
tree | ab4804a51c689a42446095a854b1dea9f74eadb0 /actionpack/lib | |
parent | 1de0df86695f8fa2eeae6b8b46f9b53decfa6ec8 (diff) | |
download | rails-e130ce456290f1efd39118419ca0783da0677ff1.tar.gz rails-e130ce456290f1efd39118419ca0783da0677ff1.tar.bz2 rails-e130ce456290f1efd39118419ca0783da0677ff1.zip |
make `as` option work with get parameters
Currently, if path is a relative path, add format without the discrimination of the query.
Therefore, if there is a query, format at end of the query would been added,
format was not be specified correctly.
This fix add format to end of path rather than query.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 8777666f9f..4f21403a90 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -336,8 +336,10 @@ module ActionDispatch end path = request_encoder.append_format_to location.path path = location.query ? "#{path}?#{location.query}" : path - else - path = request_encoder.append_format_to path + elsif !as.nil? + location = URI.parse(path) + path = request_encoder.append_format_to location.path + path = location.query ? "#{path}?#{location.query}" : path end hostname, port = host.split(':') |