aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/middleware_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Replace `serve_static_files` in tests with `public_file_server.enabled`.Kasper Timm Hansen2015-11-041-2/+2
| | | | Forgot to do it in 748b2f9, when deprecating `serve_static_files`.
* Revert "removing Rack::Runtime from the default stack."Aaron Patterson2015-10-031-9/+11
| | | | | | | | | | | | | | | | | | This reverts commit 37423e4ff883ad5584bab983aceb4b2b759a1fd8. Jeremy is right that we shouldn't remove this. The fact is that many engines are depending on this middleware to be in the default stack. This ties our hands and forces us to keep the middleware in the stack so that engines will work. To be extremely clear, I think this is another smell of "the rack stack" that we have in place. When manipulating middleware, we should have meaningful names for places in the req / res lifecycle **not** have engines depend on a particular constant be in a particular place in the stack. This is a weakness of the API that we have to figure out a way to address before removing the constant. As far as timing attacks are concerned, we can reduce the granularity such that it isn't useful information for hackers, but is still useful for developers.
* removing Rack::Runtime from the default stack.Aaron Patterson2015-10-021-11/+9
| | | | | | | | | | | | The runtime header is a potential target for timing attacks since it returns the amount of time spent on the server (eliminating network speed). Total time is also not accurate for streaming responses. The middleware can be added back via: ```ruby config.middleware.ues ::Rack::Runtime ```
* mostly remove the ParamsParser middlewareAaron Patterson2015-09-181-2/+0
| | | | | This can still be added to the middleware stack, but is really not necessary. I'll follow up with a commit that deprecates the constant
* Rely on the load interlock for non-caching reloads, tooMatthew Draper2015-07-091-7/+7
|
* Soften the lock requirements when eager_load is disabledMatthew Draper2015-07-091-4/+21
| | | | | We don't need to fully disable concurrent requests: just ensure that loads are performed in isolation.
* Add config.api_only option to application and remove appropriate middleware ↵Santiago Pastorino2015-06-111-0/+27
| | | | when true
* Allow Rack::Runtime to be deleted from middleware stack.Guo Xiang Tan2015-02-191-0/+16
| | | | Fixes: https://github.com/rails/rails/issues/16433.
* Merge pull request #18100 from chancancode/serve_static_filesGodfrey Chan2014-12-191-2/+2
| | | | | | Allow static asset serving from env variable (enhanced!) Conflicts: railties/CHANGELOG.md
* inject Rack::Lock if config.eager_load is falseXavier Noria2014-09-181-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If code is not eager loaded constants are loaded on demand. Constant autoloading is not thread-safe, so if eager loading is not enabled multi-threading should not be allowed. This showed up in certain Capybara scenarios: Most Capybara drivers other than Rack::Test need a web server. In particular, drivers for JavaScript support. Capybara launches WEBrick in its own thread for those but that per se is fine, because the spec thread and the server thread are coordinated. Problem comes if the page being served in the spec makes Ajax calls. Those may hit WEBrick in parallel, and since WEBrick is multi-threaded and allow_concurrency? returns true in the test environment before this patch, threads are spawned to serve those parallel requests. On the other hand, since eager_load is false by default in the test environment, constants are not preloaded. So the suite is autoloading constants in a multi-threaded set. That's a receipt for paracetamol. The symptom is random obscure errors whose messages point somehow to constant autoloading. As a consequence of this fix for allow_concurrency? WEBrick in Capybara scenarios no longer runs in multi-threaded mode. Fixes #15089.
* Expectations firstAkira Matsuda2014-08-281-1/+1
|
* We don't need parenthesis for thisGuillermo Iguaran2014-08-051-1/+1
|
* Fix digest ETAG test.Arthur Neves2014-08-051-1/+1
| | | | | | After https://github.com/rack/rack/commit/12528d4567d8e6c1c7e9422fee6cd8b43c4389bf ETag will include a `W/` before the digest.
* Merge pull request #12365 from jbaudanza/reorderGuillermo Iguaran2013-12-011-1/+1
|\ | | | | Move Rack::Cache after ActionDispatch::Static in the middleware stack
| * Move Rack::Cache after AD::Static in the stackJonathan Baudanza2013-09-251-1/+1
| |
* | Expose MiddlewareStack#unshift to environment configuration.Ben Pickles2013-10-091-0/+6
|/
* Added CheckPending middleware in defaultArun Agrawal2013-07-151-0/+4
| | | | | | | | | As this middleware comes by default in a new rails app Added test to check omit for CheckPending when Active Record is not included.
* No need to add config for x_sendfile_headerArun Agrawal2013-07-151-2/+0
| | | | Rack::Sendfile is loaded by default now
* Rack::Sendfile is now included in middleware by default, change tests to ↵Guillermo Iguaran2013-07-151-10/+4
| | | | reflect that
* Calls to the application constant have been refactored to usewangjohn2013-06-101-2/+2
| | | | | Rails.application when drawing routes and creating other configurations on the application.
* Testing CheckPending middlewareArun Agrawal2013-06-081-0/+8
|
* Bring config.allow_concurrency backJosé Valim2013-03-031-0/+6
| | | | | Since the Rack::Lock still exists in development, let's provide a way to disable it explicitly.
* Remove BestStandardsSupport middlewareGuillermo Iguaran2013-01-291-2/+1
|
* Don't use action_controller.perform_caching to enable rack-rack.Rafael Mendonça França2012-10-181-4/+1
| | | | | Setting the action_dispatch.rack_cache options to true or a hash should be the way to enable it.
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-4/+4
|
* config.action_dispatch.rack_cache should set explicitly to enable Rack::CacheGuillermo Iguaran2012-10-041-1/+10
|
* Remove unused require.kennyj2012-08-291-2/+0
|
* Remove allow_concurrency as a flagJosé Valim2012-08-211-2/+2
| | | | | | | | | | | | | | | | The flag was mainly used to add a Rack::Lock middleware to the stack, but the only scenario the lock is desired is in development. If you are deploying on a not-threaded server, the Rack::Lock does not provide any benefit since you don't have concurrent accesses. On the other hand, if you are on a threaded server, you don't want the lock, since it defeats the purpose of using a threaded server. If there is someone out there, running on a thread server and does want a lock, it can be added to your environment as easy as: `use Rack::Lock`
* Remove ActionDispatch::Head middleware in favor of Rack::HeadSantiago Pastorino2012-07-231-1/+1
| | | | Closes #7110 there's more work to do on rack-cache issue 69
* Freeze the middleware stack after it's builtJeremy Kemper2012-04-201-0/+7
| | | | | | So apps that accidentally add middlewares later aren't unwittingly dumping them in a black hole. Closes #5911
* Rack::SSL -> ActionDispatch::SSLRafael Mendonça França2012-03-171-3/+3
|
* Remove --http.José Valim2012-03-141-30/+0
|
* Add test to ensure setting config.generators.http_only actually disables the ↵Carlos Antonio da Silva2012-03-141-1/+1
| | | | | | generator options [Carlos Antonio da Silva & Santiago Pastorino]
* Remove IdentityMapCarlos Antonio da Silva2012-03-131-7/+0
|
* Change api_only to http_onlyCarlos Antonio da Silva2012-03-101-2/+1
| | | | [Carlos Antonio da Silva & Santiago Pastorino]
* Add config.middleware.api_only!Carlos Antonio da Silva and Santiago Pastorino2012-03-051-0/+30
|
* Handle files from ActionDispatch::Static with Rack::Sendfile (fixes #5225)Piotr Sarnacki2012-03-031-1/+1
| | | | | | | | This makes rails behave properly when you serve static assets and you have X-Sendfile headers enabled. Nevertheless in most cases you should not rely on that and serve static assets with a webserver like Apache or Nginx (as you already have it in place anyway if you use X-Sendfile)
* Deprecate RAILS_CACHE constant.kennyj2012-01-181-2/+2
|
* convert railties to use AS::TestCaseAaron Patterson2012-01-051-1/+1
|
* Add ORIGINAL_FULLPATH to envPiotr Sarnacki2011-12-211-1/+10
| | | | | | | | | | | This behaves similarly to REQUEST_URI, but we need to implement it on our own because REQUEST_URI is not reliable. Note that since PATH_INFO does not contain information about trailing question mark, this is not 100% accurate, for example `/foo?` will result in `/foo` in ORIGINAL_FULLPATH
* Split ShowExceptions responsibilities in two middlewares.José Valim2011-12-011-1/+3
|
* Allow rescue responses to be configured through a railtie.José Valim2011-12-011-21/+1
|
* Adding ActionDispatch::RequestId in middleware testArun Agrawal2011-10-201-0/+1
|
* Make the Rack::SSL middleware configurableJustin Leitgeb2011-09-261-0/+8
|
* Check that Rack::Sendfile is not included unless ↵Santiago Pastorino2011-08-131-0/+8
| | | | config.action_dispatch.x_sendfile_header is set
* Solve the RAILS_ENV problem in the railties tests in a more generic wayJon Leighton2011-06-061-1/+5
|
* Move content length to the server, this brings the same behavior as in rack 1.2.José Valim2011-05-231-7/+6
|
* Temporarily ship with ContentLength middleware.José Valim2011-05-201-3/+3
|
* Use Rack::ContentLength.José Valim2011-05-191-5/+6
|
* Fix tests to reflect IdentityMap no longer defaultDavid Lee2011-05-101-1/+1
| | | | Broke in 0e1dcae1857db4f6721561caff38d8be748d0b40