aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/middleware
Commit message (Collapse)AuthorAgeFilesLines
* Keep all session tests in the same fileRafael Mendonça França2016-03-212-46/+28
|
* Fix request.reset_session for API controllersJon Moss2016-03-191-0/+46
| | | | | | | | | | | | Due to that `ActionDispatch::Flash` (the flash API's middleware) is not included for API controllers, the `request.reset_session` method, which relies on there being a `flash=` method which is in fact defined by the middleware, was previously breaking. Similarly to how add46482a540b33184f3011c5c307f4b8e90c9cc created a method to be overridden by the flash middleware in order to ensure non-breakage, this is how flashes are now reset. Fixes #24222
* remove args from assert_nothing_raised in testsTara Scherner de la Fuente2016-02-222-5/+5
|
* Flexible configuration for ActionDispatch::SSLTim Rogers2015-12-291-1/+8
|
* Make the `static_index` config part of the `config.public_server` configYuki Nishijima2015-11-161-4/+4
| | | | Also call it `public_server.index_name` so it'll make more sense.
* Replace `serve_static_files` in tests with `public_file_server.enabled`.Kasper Timm Hansen2015-11-041-1/+1
| | | | Forgot to do it in 748b2f9, when deprecating `serve_static_files`.
* Tweaked wording used in some tests.Sebastian McKenzie2015-10-251-3/+3
|
* Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-131-0/+17
| | | | | | | | | | | | | | | Now ActionDispatch::Static can accept HTTP headers so that developers will have control of returning arbitrary headers like 'Access-Control-Allow-Origin' when a response is delivered. They can be configured through `#config.public_file_server.headers`: config.public_file_server.headers = { "Cache-Control" => "public, max-age=60", "Access-Control-Allow-Origin" => "http://rubyonrails.org" } Also deprecate `config.static_cache_control` in favor of `config.public_file_server.headers`.
* Merge pull request #20017 from eliotsykes/configurable-static-index-filenameRafael Mendonça França2015-05-281-0/+21
|\ | | | | | | config.static_index configures directory Index "index.html" filename
| * config.static_index configures directory index "index.html" filenameEliot Sykes2015-05-281-0/+21
| | | | | | | | | | | | 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"`.
* | Deprecate `:nothing` option for render methodMehmet Emin İNAÇ2015-05-281-9/+9
|/ | | | `head` method works similar to `render` method with `:nothing` option
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-033-3/+0
| | | | onwards.
* Merge pull request #18100 from chancancode/serve_static_filesGodfrey Chan2014-12-191-1/+1
| | | | | | Allow static asset serving from env variable (enhanced!) Conflicts: railties/CHANGELOG.md
* `secret_token` is now saved in `Rails.application.secrets.secret_token`Benjamin Fleischer2014-11-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | - `secrets.secret_token` is now used in all places `config.secret_token` was - `secrets.secret_token`, when not present in `config/secrets.yml`, now falls back to the value of `config.secret_token` - when `secrets.secret_token` is set, it over-writes `config.secret_token` so they are the same (for backwards-compatibility) - Update docs to reference app.secrets in all places - Remove references to `config.secret_token`, `config.secret_key_base` - Warn that missing secret_key_base is deprecated - Add tests for secret_token, key_generator, and message_verifier - the legacy key generator is used with the message verifier when secrets.secret_key_base is blank and secret_token is set - app.key_generator raises when neither secrets.secret_key_base nor secret_token are set - app.env_config raises when neither secrets.secret_key_base nor secret_token are set - Add changelog Run focused tests via ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/'
* UrlGenerationError are not catched as 404 anymoreJean Boussier2014-10-271-0/+15
|
* Don't need to account turbolinks cookies in get request.Rafael Mendonça França2014-10-131-6/+6
| | | | | | | It was changed to not set the cookie in get requests at https://github.com/rails/turbolinks/commit/62cc3db457ad9745ccda047dd43ab84fb3d89707. Related with dcb05f26.
* Refactor ActionDispatch::RemoteIpSam Aarons2014-08-211-1/+15
| | | | | | | | | | | | | Refactored IP address checking in ActionDispatch::RemoteIp to rely on the IPAddr class instead of the unwieldly regular expression to match IP addresses. This commit keeps the same api but allows users to pass IPAddr objects to config.action_dispatch.trusted_proxies in addition to passing strings and regular expressions. Example: # config/environments/production.rb config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
* Replace config.secret_key_base with secrets.secret_key_base in testGuillermo Iguaran2013-12-121-1/+1
|
* replace U+00A0 with whitespaceDmitriy Budnik2013-11-211-1/+1
|
* Make static error pages responsiveEtienne Lemay2013-11-111-1/+1
|
* Merge branch 'fix-ip-spoof-errors' of https://github.com/tamird/rails into ↵Andrew White2013-09-301-0/+10
|\ | | | | | | tamird-fix-ip-spoof-errors
| * make sure both headers are set before checking for ip spoofingTamir Duberstein2013-06-041-0/+10
| |
* | Calls to the application constant have been refactored to usewangjohn2013-06-101-1/+1
|/ | | | | Rails.application when drawing routes and creating other configurations on the application.
* Removing use of subclassed application constant and instead using thewangjohn2013-06-031-6/+6
| | | | | more agnostic Rails.application syntax. This means tests will be more portable, and won't rely on the existence of a particular subclass.
* Remove comments about removing LegacyKeyGenerator in 4.1Trevor Turk2013-04-031-1/+0
|
* Rename DummyKeyGenerator -> LegacyKeyGeneratorTrevor Turk2013-04-021-2/+2
|
* Allow transparent upgrading of legacy signed cookies to encrypted cookies; ↵Trevor Turk2013-03-281-8/+60
| | | | Automatically configure cookie-based sessions to use the best cookie jar given the app's config
* Fix some typosVipul A M2013-03-241-1/+1
|
* Remove BestStandardsSupport middlewareGuillermo Iguaran2013-01-291-30/+0
|
* Account for ignored cookie set by turbolinksNick Reed2013-01-141-6/+6
|
* Add regression test to #8907Rafael Mendonça França2013-01-141-0/+31
|
* Restore original remote_ip algorithm.Andre Arko2013-01-021-1/+1
| | | | | | | | | | | Proxy servers add X-Forwarded-For headers, resulting in a list of IPs. We remove trusted IP values, and then take the last given value, assuming that it is the most likely to be the correct, unfaked value. See [1] for a very thorough discussion of why that is the best option we have at the moment. [1]: http://blog.gingerlime.com/2012/rails-ip-spoofing-vulnerabilities-and-protection/ Fixes #7979
* Add UpgradeSignatureToEncryptionCookieStoreSantiago Pastorino2012-11-161-0/+110
| | | | | | This allows easy upgrading from the old signed Cookie Store <= 3.2 or the deprecated one in 4.0 (the ones that doesn't use key derivation) to the new one that signs using key derivation
* Remove duplicated get /foo/write_sessionSantiago Pastorino2012-11-161-1/+0
|
* Remove unused config optionSantiago Pastorino2012-11-161-1/+0
|
* Use derived keys everywhere, http_authentication was missing itSantiago Pastorino2012-11-031-1/+3
|
* Add encrypted cookie storeSantiago Pastorino2012-11-031-0/+51
|
* Don't use action_controller.perform_caching to enable rack-rack.Rafael Mendonça França2012-10-181-2/+12
| | | | | 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-142-13/+13
|
* Fix middleware cache tests enabling rack_cacheGuillermo Iguaran2012-10-051-0/+2
|
* Implement :null_session CSRF protection methodSergey Nartimov2012-09-131-0/+82
| | | | | | | | It's further work on CSRF after 245941101b1ea00a9b1af613c20b0ee994a43946. The :null_session CSRF protection method provide an empty session during request processing but doesn't reset it completely (as :reset_session does).
* Fixes wrong test class names.kennyj2012-08-291-1/+1
|
* Fix failure on middleware/exceptions_testJosé Valim2012-08-231-10/+4
| | | | | | | The reason the test was failing was because when the test invokes `app.config`, the app is loaded and, as `eager_load` is set to true, it disables the dependency loading mechanism, so controllers that are later defined are not loaded.
* Remove app building setup/teardown for remote ip railtie testsCarlos Antonio da Silva2012-08-211-14/+0
| | | | | These tests rely on "make_basic_app", which is a faster version that does not need to create the whole app directory structure.
* Failing test for #6034Piotr Sarnacki2012-04-301-0/+20
|
* Remove default match without specified methodJose and Yehuda2012-04-242-2/+2
| | | | | | | | | | | | | | | | In the current router DSL, using the +match+ DSL method will match all verbs for the path to the specified endpoint. In the vast majority of cases, people are currently using +match+ when they actually mean +get+. This introduces security implications. This commit disallows calling +match+ without an HTTP verb constraint by default. To explicitly match all verbs, this commit also adds a :via => :all option to +match+. Closes #5964
* Freeze the middleware stack after it's builtJeremy Kemper2012-04-201-17/+18
| | | | | | So apps that accidentally add middlewares later aren't unwittingly dumping them in a black hole. Closes #5911
* Handle files from ActionDispatch::Static with Rack::Sendfile (fixes #5225)Piotr Sarnacki2012-03-031-0/+13
| | | | | | | | 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)
* config.force_ssl should mark the session as secure.José Valim2012-01-131-0/+30
|
* convert railties to use AS::TestCaseAaron Patterson2012-01-056-6/+6
|