aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
Commit message (Collapse)AuthorAgeFilesLines
* Add DSL for configuring Content-Security-Policy headerAndrew White2017-11-272-0/+234
| | | | https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
* Merge pull request #31195 from mltsy/patch-2Vipul A M2017-11-241-1/+1
|\ | | | | Fix tld_length documentation in ActionDispatch::Cookies [ci skip]
| * Fix tld_length documentationJoe Marty2017-11-211-1/+1
| | | | | | Change recommendation for tld_length (for sharing cookies across subdomains of a 2-token TLD), to 2 instead of 1.
* | Fix CustomUrls#direct doc formattingT.J. Schuck2017-11-221-6/+6
| | | | | | | | | | Particularly, the bulleted list was getting formatted as a code block because of the extra level of indentation. Pulling it back to the left makes it render properly as a list instead. [ci skip]
* | Update incorrect backtick usage in RDoc to teletypeT.J. Schuck2017-11-221-1/+1
|/ | | [ci skip]
* Merge pull request #31078 from aeroastro/feature/fix-typoRafael França2017-11-091-2/+2
|\ | | | | Fix typoes on ActionDispatch::HTTP::FilterParameters
| * Fix typo on ActionDispatc::HTTP::FilterParametersTakumasa Ochi2017-11-071-2/+2
| |
* | Merge pull request #22435 from yui-knk/fix_engine_route_testRafael Mendonça França2017-11-063-6/+15
|\ \ | | | | | | | | | Make `assert_recognizes` to traverse mounted engines
| * | Make `assert_recognizes` to traverse mounted enginesyui-knk2016-04-233-6/+15
| | | | | | | | | | | | | | | | | | Before this commit paths of mounted engines are not traversed when `assert_recognizes` is called, causing strange test results. This commit enable to traverse mounted paths.
* | | Explicitly pass window handle to `resize_window_to`yuuji.yaginuma2017-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike `resize_window`, `resize_window_to` has three arguments. https://github.com/thoughtbot/capybara-webkit/blob/d63c3c8e3ae844f0c59359532a6dcb50f4a64d0a/lib/capybara/webkit/driver.rb#L135-L143 Therefore, if pass only width and height just like `resize_window`, `ArgumentError`will be raised. To prevent this, explicitly pass window handler. Follow up of #31046
* | | Merge pull request #31046 from NARKOZ/fix-capybara-webkit-deprecationEileen M. Uchitelle2017-11-041-1/+1
|\ \ \ | | | | | | | | Fix Capybara::Webkit::Driver#resize_window deprecation warning
| * | | Fix Capybara::Webkit::Driver#resize_window deprecation warningNihad Abbasov2017-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | >[DEPRECATION] Capybara::Webkit::Driver#resize_window is deprecated. Please use Capybara::Window#resize_to instead.
* | | | Improve docs of ActionDispatch::Routing::Mapperbogdanvlviv2017-11-031-4/+14
|/ / /
* | | Merge pull request #31034 from haneru/edit-commentEileen M. Uchitelle2017-11-021-1/+1
|\ \ \ | | | | | | | | [ci skip]Fix typo in comments.
| * | | Edited comment from request.rbhaneru2017-11-031-1/+1
| | | |
* | | | Prevent source line wrapping in rescue layoutDave Gynn2017-10-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Long source lines cause line wrapping in the extracted source section of the rescue handler page which can make the line numbers not match up with the source lines.
* | | | removed unnecessary returnsShuhei Kitagawa2017-10-281-1/+1
|/ / /
* | | Merge pull request #31003 from y-yagi/add_load_hook_for_system_test_caseRyuta Kamizono2017-10-281-0/+2
|\ \ \ | | | | | | | | Add load hook for `ActionDispatch::SystemTestCase`
| * | | Add load hook for `ActionDispatch::SystemTestCase`yuuji.yaginuma2017-10-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful to extend `SystemTestCase`. Also, since other test classes already have load hooks, should also be in `SystemTestCase`. Ref: 0510208dd1ff23baa619884c0abcae4d141fae53
* | | | Merge pull request #31001 from eugeneius/rm_x_post_data_format_docRyuta Kamizono2017-10-281-3/+0
|\ \ \ \ | | | | | | | | | | Remove mention of X-Post-Data-Format header [ci skip]
| * | | | Remove mention of X-Post-Data-Format header [ci skip]Eugene Kenny2017-10-281-3/+0
| |/ / / | | | | | | | | | | | | | | | | Support for this header was removed when `actionpack-xml_parser` was extracted, and has since been dropped from the gem.
* / / / Puma Rack handler is required by CapybaraGuillermo Iguaran2017-10-281-2/+0
|/ / / | | | | | | See: https://github.com/teamcapybara/capybara/blob/7d693f068c44f6a460336da70fb6e9e5f94f3db9/lib/capybara.rb#L450
* | | Require capybara 2.15 because we depend on the new puma integrationRafael Mendonça França2017-10-251-1/+1
| | |
* | | specify minimum capybara version for system testsJoe Francis2017-10-231-0/+2
| | | | | | | | | | | | | | | | | | Upgraded rails applications may have a Gemfile without a new enough capybara to run system tests. Setting a version here gives the user a more direct error message than they get otherwise. Resolves #30952
* | | Change the deprecation horizon of the dynamic routes segment to 6.0Rafael Mendonça França2017-10-231-2/+2
| | |
* | | Remove deprecated `ActionController::ParamsParser::ParseError`Rafael Mendonça França2017-10-231-5/+0
| | |
* | | [Action Pack] require => require_relativeAkira Matsuda2017-10-2127-58/+58
| | | | | | | | | | | | | | | This basically reverts e9fca7668b9eba82bcc832cb0061459703368397, d08da958b9ae17d4bbe4c9d7db497ece2450db5f, d1fe1dcf8ab1c0210a37c2a78c1ee52cf199a66d, and 68eaf7b4d5f2bb56d939f71c5ece2d61cf6680a3
* | | Merge pull request #30876 from y-yagi/selenium_chrome_headlessEileen M. Uchitelle2017-10-172-1/+19
|\ \ \ | | | | | | | | Add headless chrome driver to System Tests
| * | | Add headless chrome driver to System Testsyuuji.yaginuma2017-10-172-1/+19
| | | |
* | | | [ci skip]Enable link to ActionDispatch::Integration::Session#process in rdocwillnet2017-10-121-12/+12
|/ / /
* | | Exception message for SystemTestCase#get etc..yalab2017-10-081-1/+1
| | |
* | | Implement H2 Early Hints for Railseileencodes2017-10-041-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When puma/puma#1403 is merged Puma will support the Early Hints status code for sending assets before a request has finished. While the Early Hints spec is still in draft, this PR prepares Rails to allowing this status code. If the proxy server supports Early Hints, it will send H2 pushes to the client. This PR adds a method for setting Early Hints Link headers via Rails, and also automatically sends Early Hints if supported from the `stylesheet_link_tag` and the `javascript_include_tag`. Once puma supports Early Hints the `--early-hints` argument can be passed to the server to enable this or set in the puma config with `early_hints(true)`. Note that for Early Hints to work in the browser the requirements are 1) a proxy that can handle H2, and 2) HTTPS. To start the server with Early Hints enabled pass `--early-hints` to `rails s`. This has been verified to work with h2o, Puma, and Rails with Chrome. The commit adds a new option to the rails server to enable early hints for Puma. Early Hints spec: https://tools.ietf.org/html/draft-ietf-httpbis-early-hints-04 [Eileen M. Uchitelle, Aaron Patterson]
* | | Don't use Active Support where it is not needed.yuuji.yaginuma2017-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This code has been changed with https://github.com/rails/rails/pull/30735/files#diff-8e5f6b33c191ad6dec07f3288345a13fL47. However, `active_support/time` is not load automatically, so if use Action Pack alone, `days` method can not use and an error occurs. In this case, I think that there is no problem by specifying a value with Integer.
* | | Merge pull request #30735 from tjschuck/fix_doc_code_formattingEileen M. Uchitelle2017-09-291-33/+38
|\ \ \ | | | | | | | | Fix formatting in ActionDispatch::SSL middleware docs
| * | | Fix formatting in ActionDispatch::SSL middleware docsT.J. Schuck2017-09-271-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: https://monosnap.com/file/J6xewF0tYpm6dC9nSTe82ddsHAOcM5.png After: https://monosnap.com/file/0tCYicLXNqRHAEMDb81u0aLb3gH9Wf.png [ci skip]
* | | | Merge pull request #30709 from ↵Kasper Timm Hansen2017-09-281-3/+10
|\ \ \ \ | |/ / / |/| | | | | | | | | | | mikeycgto/actiondispatch-use-aead-encrypted-cookies-patch Fixes for use_authenticated_cookie_encryption
| * | | Fixes for use_authenticated_cookie_encryptionMichael Coyne2017-09-271-3/+10
| | |/ | |/| | | | | | | Use CBC encryption is this configuration value is set to false
* / | Fix cookies/session tests broken after merging key rotation.Kasper Timm Hansen2017-09-251-2/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | Based on, yet closes https://github.com/rails/rails/pull/30708 Fix the session test by properly truncating the legacy encryption key for cbc encryption. Borrowed straight from 👆. Fix the cookies test a little differently than the PR. Basically keep every config within the config block. [ Michael Coyne & Kasper Timm Hansen ]
* | Fix "warning: `*' interpreted as argument prefix"Ryuta Kamizono2017-09-251-2/+2
| |
* | Use new rotation signature in cookies.Kasper Timm Hansen2017-09-241-11/+12
| | | | | | | | [ Michael Coyne & Kasper Timm Hansen ]
* | Add key rotation cookies middlewareMichael Coyne2017-09-242-102/+86
| | | | | | | | | | | | Using the action_dispatch.cookies_rotations interface, key rotation is now possible with cookies. Thus the secret_key_base as well as salts, ciphers, and digests, can be rotated without expiring sessions.
* | Use the default Capybara registered puma server configurationThomas Walpole2017-09-181-13/+1
| |
* | [ci skip] Prefer credentials to secrets in docs.Kasper Timm Hansen2017-09-132-28/+12
| | | | | | | | | | | | | | Removes most mentions of secrets.secret_key_base and explains credentials instead. Also removes some very stale upgrade notices about Rails 3/4.
* | Add credentials using a generic EncryptedConfiguration class (#30067)David Heinemeier Hansson2017-09-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP: Add credentials using a generic EncryptedConfiguration class This is sketch code so far. * Flesh out EncryptedConfiguration and test it * Better name * Add command and generator for credentials * Use the Pathnames * Extract EncryptedFile from EncryptedConfiguration and add serializers * Test EncryptedFile * Extract serializer validation * Stress the point about losing comments * Allow encrypted configuration to be read without parsing for display * Use credentials by default and base them on the master key * Derive secret_key_base in test/dev, source it from credentials in other envs And document the usage. * Document the new credentials setup * Stop generating the secrets.yml file now that we have credentials * Document what we should have instead Still need to make it happen, tho. * [ci skip] Keep wording to `key base`; prefer defaults. Usually we say we change defaults, not "spec" out a release. Can't use backticks in our sdoc generated documentation either. * Abstract away OpenSSL; prefer MessageEncryptor. * Spare needless new when raising. * Encrypted file test shouldn't depend on subclass. * [ci skip] Some woordings. * Ditch serializer future coding. * I said flip it. Flip it good. * [ci skip] Move require_master_key to the real production.rb. * Add require_master_key to abort the boot process. In case the master key is required in a certain environment we should inspect that the key is there and abort if it isn't. * Print missing key message and exit immediately. Spares us a lengthy backtrace and prevents further execution. I've verified the behavior in a test app, but couldn't figure the test out as loading the app just exits immediately with: ``` /Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `load': marshal data too short (ArgumentError) from /Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `run' from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:830:in `run_one_method' from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest/parallel.rb:32:in `block (2 levels) in start' ``` It's likely we need to capture and prevent the exit somehow. Kernel.stub(:exit) didn't work. Leaving it for tomorrow. * Fix require_master_key config test. Loading the app would trigger the `exit 1` per require_master_key's semantics, which then aborted the test. Fork and wait for the child process to finish, then inspect the exit status. Also check we aborted because of a missing master key, so something else didn't just abort the boot. Much <3 to @tenderlove for the tip. * Support reading/writing configs via methods. * Skip needless deep symbolizing. * Remove save; test config reader elsewhere. * Move secret_key_base check to when we're reading it. Otherwise we'll abort too soon since we don't assign the secret_key_base to secrets anymore. * Add missing string literal comments; require unneeded yaml require. * ya ya ya, rubocop. * Add master_key/credentials after bundle. Then we can reuse the existing message on `rails new bc4`. It'll look like: ``` Using web-console 3.5.1 from https://github.com/rails/web-console.git (at master@ce985eb) Using rails 5.2.0.alpha from source at `/Users/kasperhansen/Documents/code/rails` Using sass-rails 5.0.6 Bundle complete! 16 Gemfile dependencies, 72 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Adding config/master.key to store the master encryption key: 97070158c44b4675b876373a6bc9d5a0 Save this in a password manager your team can access. If you lose the key, no one, including you, can access anything encrypted with it. create config/master.key ``` And that'll be executed even if `--skip-bundle` was passed. * Ensure test app has secret_key_base. * Assign secret_key_base to app or omit. * Merge noise * Split options for dynamic delegation into its own method and use deep symbols to make it work * Update error to point to credentials instead * Appease Rubocop * Validate secret_key_base when reading it. Instead of relying on the validation in key_generator move that into secret_key_base itself. * Fix generator and secrets test. Manually add config.read_encrypted_secrets since it's not there by default anymore. Move mentions of config/secrets.yml to config/credentials.yml.enc. * Remove files I have no idea how they got here. * [ci skip] swap secrets for credentials. * [ci skip] And now, changelogs are coming.
* | Merge pull request #30367 from ptoomey3/consistent-cache-control-headersAaron Patterson2017-09-052-8/+13
|\ \ | | | | | | Normalize/process Cache-Control headers consistently
| * | Don't touch an unused headerPatrick Toomey2017-08-231-1/+0
| | | | | | | | | | | | | | | | | | The prior logic explictly set `Cache-Control` to `nil`. But, we would only reach that logic if the header was not set to begin with. So, rather than give it any value at all, just leave it alone.
| * | Decouple the merge/normalization and conditional cache control logicPatrick Toomey2017-08-232-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prior logic was trying to do too many things at once. For all responses, we want to perform two distinct steps: * Merge/normalize the `Cache-Control` values found in HTTP headers and those found in the `@cache_control` hash. * Conditionally set a default `Cache-Control` header value when we have an ETag This change separates these concerns since the merge/normalize step should occur for all responses, but the second should only occur when we have already set an ETag/last modified value. Normally ETag middleware will set a default `Cache-Control`, but only if an existing ETag is not already set. So, in the cases where an ETag is set, we need to set the default `Cache-Control` value ourselves.
| * | This constant is no longer usedPatrick Toomey2017-08-221-1/+0
| | |
| * | Let middleware handle default cache behaviorPatrick Toomey2017-08-221-1/+2
| | |
| * | Normalize/process Cach-Control headers consistentlyPatrick Toomey2017-08-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the existing logic, the `Cache-Control` header may or may not get normalized by additional logic depending on whether `response.cache_conrol` has been modified. This leads to inconsistent behavior, since sometimes `Cache-Control` can contain whatever a user sets and sometimes it gets normalized, based on the logic inside of `set_conditional_cache_control!`. It seems like this normalization process should happen regardless to ensure consistent behavior.