aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
Commit message (Collapse)AuthorAgeFilesLines
* Refactor cookie_jar to decouple it from request objecteileencodes2015-07-051-7/+3
| | | | | | This change decouples `cookie_jar` allocation from the request object. We need this for moving controller tests to integration tests so we can access the `cookie_jar` object separately.
* [ci skip] Improve the url_for documentationRoque Pinel2015-07-011-3/+19
| | | | | | | | | Clarify the `url_for` usage in mailers. Re-add the documentation about `url_for` and Route's path parameters, first introduced by 5c4f1859970d06228a0b67cad6d4486c1526ef2a. This was reported on #15097 and until it is decided to deprecate it or not, I believe the documentation should exist.
* Merge pull request #19431 from hmarr/head-routingRafael Mendonça França2015-06-221-1/+2
|\ | | | | Respect routing precedence for HEAD requests
| * Respect routing precedence for HEAD requestsHarry Marr2015-03-201-1/+2
| | | | | | | | | | | | | | Fixes the issue described in #18764 - prevents Rack middleware from swallowing up HEAD requests that should have been matched by a higher-precedence `get` route, but still allows Rack middleware to respond to HEAD requests.
* | Revert "Merge pull request #20584 from arthurnn/fix_url"Arthur Neves2015-06-171-8/+4
| | | | | | | | | | | | | | | | This reverts commit 0b3397872582f2cf1bc6960960a6393f477c55e6, reversing changes made to 56d52e3749180e6c1dcf7166adbad967470aa78b. As pointed out on the PR, this will hide development mistakes too, which is not ideal.
* | Merge pull request #20584 from arthurnn/fix_urlArthur Nogueira Neves2015-06-161-4/+8
|\ \ | | | | | | Catch InvalidURIError on bad paths on redirect.
| * | Catch InvalidURIError on bad paths on redirect.Arthur Neves2015-06-161-4/+8
| | | | | | | | | | | | | | | Handle URI::InvalidURIError errors on the redirect route method, so it wont raise a 500 if a bad path is given.
* | | Fix the comment about attr_reader of headers [ci skip]Mehmet Emin İNAÇ2015-06-161-1/+1
|/ /
* | remove `header=` on the response object.Aaron Patterson2015-06-152-13/+14
| | | | | | | | | | | | People should be free to mutate the header object, but not to set a new header object. That header object may be specific to the webserver, and we need to hide it's internals.
* | set the default charset in response initializeAaron Patterson2015-06-151-4/+12
| | | | | | | | | | this way we don't have to mutate the instance (as much) when writing a rack response
* | ActionDispatch::SSL should keep original header's behaviorFumiaki MATSUSHIMA2015-06-141-1/+1
| | | | | | | | | | | | `ActionDispatch::SSL` changes headers to `Hash`. So some headers will be broken if there are some middlewares on ActionDispatch::SSL and if it uses `Rack::Utils::HeaderHash`.
* | don't hold a reference to `env` in the options objectAaron Patterson2015-06-131-13/+11
| | | | | | | | | | I want to decouple Rails from the rack ENV as much as possible. We should try to keep as few references to the env as possible
* | Handle param-parsing errors from Rack in ExceptionWrapperGrey Baker2015-06-121-1/+3
| |
* | Revert changes related with api apps in RouteWrapperJorge Bejar2015-06-111-11/+1
| | | | | | | | | | See the following commit to have context about this change: https://github.com/rails/rails/commit/757a2bc3e3e52a5d9418656928db993db42b741b
* | Routes resources avoid :new and :edit endpoints if api_only is enabledJorge Bejar2015-06-112-12/+35
| |
* | Refactor internal? to query internal_controller? and internal_asset? methodsSantiago Pastorino2015-06-111-1/+11
| |
* | Remove Unneeded ApiPublicExceptions middleware, PublicExceptions already ↵Santiago Pastorino2015-06-111-46/+0
| | | | | | | | does the work
* | Adhere to Rails convention for private indentationSantiago Pastorino2015-06-111-21/+20
| |
* | Add ApiPublicException middlewareSantiago Pastorino2015-06-111-0/+47
| |
* | Change the `index` arg of `ActionDispatch::Static#new` to a kwargYuki Nishijima2015-06-111-4/+3
| |
* | remove unused codeAaron Patterson2015-06-081-2/+2
| |
* | we only care about methods that the request object responds toAaron Patterson2015-06-081-2/+1
| | | | | | | | | | matches? should only deal with methods on the request object, so lets just filter out anything that the request object doesn't respond to
* | extract required_defaults from the conditions hash before constructing the routeAaron Patterson2015-06-083-8/+8
| | | | | | | | | | this way we can remove the strange "respond_to?" conditional in the `matches?` loop
* | Add missing documentation for ActionDispatch::Request::Session [ci skip]Mehmet Emin İNAÇ2015-06-071-0/+33
| |
* | A few documentation tweaks [ci skip]Robin Dupret2015-06-071-2/+2
| | | | | | | | [Robin Dupret & Shunsuke Aida]
* | pass check_ip and proxies to GetIp constructorAaron Patterson2015-06-031-4/+4
| | | | | | | | | | The `GetIp` class doesn't need to keep a reference to the middleware, so there is no reason to pass the middleware instance to the `GetIp` class
* | Merge pull request #20383 from jonatack/fix-configurable-static-index-filenameSantiago Pastorino2015-06-021-3/+3
|\ \ | | | | | | Fix regression in #20017 wrong number of arguments error
| * | Fix regression in #20017: wrong number of arguments errorJon Atack2015-05-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and use coherent quoting/spacing. This should hopefully fix a regression that was introduced with #20017, causing deployment pushes to Heroku to be rejected with the following trace: ArgumentError: wrong number of arguments (2 for 3) remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s tatic.rb:16:in `initialize' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/gem s/heroku-deflater-0.5.3/lib/heroku-deflater/serve_zipped_assets.rb:15:in `new' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/gem s/heroku-deflater-0.5.3/lib/heroku-deflater/serve_zipped_assets.rb:15:in `initialize' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s tack.rb:43:in `new' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s tack.rb:43:in `build' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s tack.rb:118:in `block in build' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s tack.rb:118:in `each' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s tack.rb:118:in `inject' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/actionpack/lib/action_dispatch/middleware/s tack.rb:118:in `build' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/railties/lib/rails/engine.rb:509:in `app' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/railties/lib/rails/application/finisher.rb: 34:in `block in <module:Finisher>' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:30:in `instance_exec' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:30:in `run' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:55:in `block in run_initializers' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/railties/lib/rails/initializable.rb:54:in `run_initializers' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/vendor/bundle/ruby/2.2.0/bun dler/gems/rails-0ef7e73f0af7/railties/lib/rails/application.rb:352:in `initialize!' remote: /tmp/build_a3b8845b716508af12d99859d1a58c5c/config/environment.rb:5:in `<top (required)>'
* | | Merge pull request #20410 from schneems/schneems/boo-global-varsRafael Mendonça França2015-06-011-1/+1
|\ \ \ | | | | | | | | Use block variable instead of global
| * | | Use block variable instead of globalschneems2015-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ```ruby require 'benchmark/ips' Benchmark.ips do |x| x.report("$&") { "foo".sub(/f/) { $&.upcase } } x.report("block var") { "foo".sub(/f/) {|match| match.upcase } } end ``` ``` Calculating ------------------------------------- $& 48.658k i/100ms block var 49.666k i/100ms ------------------------------------------------- $& 873.156k (± 9.3%) i/s - 4.331M block var 969.744k (± 9.2%) i/s - 4.818M ``` It's faster, and gets rid of a few "magic" global variables
* | | | Merge pull request #20138 from tgxworld/deprecated_assert_templateRafael Mendonça França2015-06-013-5/+3
|\ \ \ \ | | | | | | | | | | Deprecate `assert_template` and `assigns()`.
| * | | | Remove `assigns` and `assert_template`.Guo Xiang Tan2015-05-303-5/+3
| |/ / /
* | / / Use `any?` rather than `present?` to check argseileencodes2015-05-311-1/+1
| |/ / |/| | | | | | | | | | | | | | It's better to use Ruby methods when possible over methods defined by Active Support because then it does not need to rely on any dependencies.
* | | match method doc fix [ci skip]Mehmet Emin İNAÇ2015-05-301-3/+6
| | | | | | | | | | | | | | | | | | match method without setting `:via` option has been deprecated fix minor typo
* | | [ci skip] match without via is now deprecatedYoong Kang Lim2015-05-301-1/+1
|/ /
* | Merge pull request #20341 from ↵Rafael Mendonça França2015-05-281-36/+0
|\ \ | | | | | | | | | | | | vngrs/remove_already_defined_methods_in_rack_request Remove already defined methods in super class of ActionDispatch::Request class
| * | Remove already defined methods in super class of ActionDispatch::Request classMehmet Emin İNAÇ2015-05-281-36/+0
| | | | | | | | | | | | | | | | | | | | | These methods had defined in 2004 by dhh in initial commit and `ActionDispatch::Request` class has been inherited from `Rack::Request` class in 2009 by josh. In 2014 these methods and more of them defined in `Rack::Request` class so we don't need them anymore in rails codebase.
* | | config.static_index configures directory index "index.html" filenameEliot Sykes2015-05-281-4/+5
|/ / | | | | | | | | | | Set `config.static_index` to serve a static directory index file not named `index`. For example, to serve `main.html` instead of `index.html` for directory requests, set `config.static_index` to `"main"`.
* | Merge pull request #20329 from EduardoBautista/json-api-supportRafael Mendonça França2015-05-271-1/+1
|\ \ | | | | | | Add application/vnd.api+json alias to the JSON MIME Type.
| * | Add application/vnd.api+json alias to the JSON MIME Type.Eduardo Bautista2015-05-271-1/+1
| | |
* | | Documentation for ActionDispatch::Request form_data? method [ci skip]Mehmet Emin İNAÇ2015-05-271-0/+2
| | |
* | | Add missing nodocs and docs for ActionDispatch::Request [ci skip]Mehmet Emin İNAÇ2015-05-261-3/+5
| | | | | | | | | | | | add missing dot to end of the doc
* | | Use memoization while accessing request headers for minimizing memory usageMehmet Emin İNAÇ2015-05-251-1/+1
|/ /
* | remove useless ivarAaron Patterson2015-05-231-1/+0
| | | | | | | | I should have deleted this earlier with 42e66fac38b54dd53d062fb5d3376218ed2ffdae
* | add a branch to eliminate multiple nil checksAaron Patterson2015-05-231-3/+5
| | | | | | | | | | if we add an else conditional to the `presence` check, we can eliminate the second `||` branch in the caller
* | move request id manipulation to the request objectAaron Patterson2015-05-222-7/+18
| | | | | | | | this way we can keep the knowledge of `env` hash keys in one place.
* | Spelling/typo/grammatical fixes [ci skip]karanarora2015-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | spelling fix [ci skip] example to be consistent [ci skip] grammatical fix typo fixes [ci skip]
* | ActionDispatch::Journey::Routes#empty? test casesValentine Valyaeff2015-05-191-1/+1
| |
* | Added ActionDispatch::Journey::Routes#empty?juggernaut-2015-05-181-0/+4
| |
* | [ci skip] remove `assigns` from the integration test example in API docsRoque Pinel2015-05-171-2/+2
| | | | | | | | Based on #19976 and #18305.