aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
Commit message (Collapse)AuthorAgeFilesLines
* Suppress `warning: BigDecimal.new is deprecated`Yasuo Honda2017-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | `BigDecimal.new` has been deprecated in BigDecimal 1.3.3 which will be a default for Ruby 2.5. Refer https://github.com/ruby/bigdecimal/commit/533737338db915b00dc7168c3602e4b462b23503 * This commit has been made as follows: ``` cd rails git grep -l BigDecimal.new | grep -v guides/source/5_0_release_notes.md | grep -v activesupport/test/xml_mini_test.rb | xargs sed -i -e "s/BigDecimal.new/BigDecimal/g" ``` - `activesupport/test/xml_mini_test.rb` Editmanually to remove `.new` and `::` - guides/source/5_0_release_notes.md This is a Rails 5.0 release notes.
* Merge pull request #31289 from witlessbird/fips-compatibilityEileen M. Uchitelle2017-12-142-2/+2
|\ | | | | Initial support for running Rails on FIPS-certified systems
| * Introduced `ActiveSupport::Digest` that allows to specify hash function ↵Dmitri Dolguikh2017-12-122-2/+2
| | | | | | | | | | | | | | | | implementation and defaults to `Digest::MD5`. Replaced calls to `::Digest::MD5.hexdigest` with calls to `ActiveSupport::Digest.hexdigest`.
* | Enable `Layout/LeadingCommentSpace` to not allow cosmetic changes in the futureRyuta Kamizono2017-12-142-2/+1
| | | | | | | | Follow up of #31432.
* | Enable `Layout/SpaceBeforeComma` rubocop rule, and fixed moreRyuta Kamizono2017-12-122-3/+3
| | | | | | | | Follow up of #31390.
* | Add secure `X-Download-Options` and `X-Permitted-Cross-Domain-Policies` to ↵Guillermo Iguaran2017-12-091-1/+1
| | | | | | | | default headers set.
* | Merge pull request #30780 from ↵Sean Griffin2017-12-071-0/+13
|\ \ | | | | | | | | | | | | JackMc/fix-chrome-referrer-invalidauthenticitytoken Fix issue #30658 by checking explicitly for 'null' referrer
| * | Add a better error message when a "null" Origin header occursJack McCracken2017-11-031-0/+13
| | |
* | | Correct routing test spelling mistake.Philip Tolton2017-12-061-1/+1
| | |
* | | Yield array from AC::Parameters#each for block with one argDominic Cleal2017-12-061-0/+16
| |/ |/| | | | | Matches Hash#each behaviour as used in Rails 4.
* | Update send_file headers test to use mp4 as example instead of mpgGuillermo Iguaran2017-11-281-1/+1
| |
* | Merge pull request #31099 from nobu/patch-1Rafael Mendonça França2017-11-091-1/+1
|\ \ | |/ |/| | | Use `Tempfile.create`
| * Use `Dir.mktmpdir`Nobuyoshi Nakada2017-11-091-1/+1
| | | | | | | | As `@cache_path` is expected to be a directory name, use `Dir.mktmpdir`. And omit unnecessary `Dir.tmpdir`.
| * Use `Tempfile.create`Nobuyoshi Nakada2017-11-091-1/+1
|/ | | Instead of `Dir::Tmpname.make_tmpname`, an internal method which does not guarantee uniqueness, use `Tempfile.create`.
* Merge pull request #31004 from shuheiktgw/remove_unnecessary_returnsRafael França2017-10-311-1/+1
|\ | | | | Remove redundant return statements
| * removed unnecessary returnsShuhei Kitagawa2017-10-281-1/+1
| |
* | Merge pull request #31005 from shuheiktgw/remove_unnecessary_semicolonsMatthew Draper2017-10-283-8/+8
|\ \ | |/ |/| | | Removed unnecessary semicolons
| * removed unnecessary semicolonsShuhei Kitagawa2017-10-282-7/+7
|/
* checking for nested attributes when attribute names specified to wrap them ↵Kelton Manzanares2017-10-251-0/+14
| | | | as well
* Add allow_other_host option to redirect_back methodTim Masliuchenko2017-10-101-0/+21
|
* Remove `:api:` tag that has leaked on the doc directly [ci skip]Ryuta Kamizono2017-09-301-3/+0
| | | | | | | | | | | | Currently `:api:` tag has leaked on the doc directly since RDoc doesn't support `:api:` tag directive. http://api.rubyonrails.org/v5.1/classes/AbstractController/Rendering.html So `:api: private` doesn't work as expected. We are using `:nodoc:` for the purpose. Related #13989.
* Add key rotation cookies middlewareMichael Coyne2017-09-242-2/+6
| | | | | | 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.
* fix type fully qualified [ci skip]Yauheni Dakuka2017-09-061-1/+1
|
* Merge pull request #30367 from ptoomey3/consistent-cache-control-headersAaron Patterson2017-09-051-0/+21
|\ | | | | Normalize/process Cache-Control headers consistently
| * Use equality in place of refute assertions for accuracyPatrick Toomey2017-08-221-4/+2
| |
| * Normalize/process Cach-Control headers consistentlyPatrick Toomey2017-08-221-0/+23
| | | | | | | | | | | | | | | | | | | | 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.
* | Fix `can't modify frozen String` error in AC::RenderingKoichi ITO2017-09-021-0/+12
|/
* Fix RuboCop offensesKoichi ITO2017-08-164-17/+17
| | | | And enable `context_dependent` of Style/BracesAroundHashParameters cop.
* Path parameters should default to UTF8eileencodes2017-08-011-0/+16
| | | | | | | | | | | | | | | | | | | | This commit changes the behavior such the path_params now default to UTF8 just like regular parameters. This also changes the behavior such that if a path parameter contains invalid UTF8 it returns a 400 bad request. Previously the behavior was to encode the path params as binary but that's not the same as query params. So this commit makes path params behave the same as query params. It's important to test with a path that's encoded as binary because that's how paths are encoded from the socket. The test that was altered was changed to make the behavior for bad encoding the same as query params. We want to treat path params the same as query params. The params in the test are invalid UTF8 so they should return a bad request. Fixes #29669 *Eileen M. Uchitelle, Aaron Patterson, & Tsukuru Tanimichi*
* Use frozen string literal in actionpack/Kir Shatrov2017-07-2979-0/+158
|
* Make actionpack frozen string friendlyKir Shatrov2017-07-246-7/+19
|
* [Action Pack] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Add ActionController::Base.skip_forgery_protectionLisa Ugray2017-07-101-0/+30
| | | | | | Since we now default to `protect_from_forgery with: :exception`, provide a wrapper to `skip_before_action :verify_authenticity_token` for disabling forgery protection.
* Prepare AP and AR to be frozen string friendlyKir Shatrov2017-07-061-1/+2
|
* Merge pull request #29566 from eugeneius/wrap_parameters_queryKasper Timm Hansen2017-07-021-0/+8
|\ | | | | Don't wrap parameters if query parameter exists
| * Don't wrap parameters if query parameter existsEugene Kenny2017-06-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | We want to avoid overwriting a query parameter with the wrapped parameters hash. Previously this was implemented by merging the wrapped parameters at the root level if the key already existed, which was effectively a no-op. The query parameter was still overwritten in the filtered parameters hash, however. We can fix that discrepancy with a simpler implementation and less unnecessary work by skipping parameter wrapping entirely if the key was sent as a query parameter.
* | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-0286-86/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* | Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-0286-0/+86
|\ \ | | | | | | | | | Enforce frozen string in Rubocop
| * | Enforce frozen string in RubocopKir Shatrov2017-07-0186-0/+86
| | |
* | | Fallback Parameters#to_s to Hash#to_sKir Shatrov2017-06-301-0/+5
|/ / | | | | Fixes https://github.com/rails/rails/issues/29617
* / Calling `follow_redirect!` does not reset the `html_document`:Edouard CHIN2017-06-261-0/+12
|/ | | | | | | | | | | | | - When making a request to a controller that redirects, `follow_redirect!` would not reset the `html_document` ivar, it only resets the `html_document` ivar from the session (not the runner) - If one was doing something like this; ```ruby get '/redirect' assert_select 'you are being redirected' follow_redirect! # html_document is memoized and doesn't get reset ``` - To fix the issue we can do the same for any other methods (`get`, `post`...) and define a method in the runner that delegates to the session but clears the html_document_first - Fixes #29367
* Don't wrap parameters if key already existsEugene Kenny2017-06-241-0/+8
| | | | | | | | | | | | | | | | | We shouldn't perform parameter wrapping if it would overwrite one of the parameters sent with the request, as that would interfere with reading the parameter directly from the top level `params` hash. The current implementation has logic for this case, but it doesn't handle `nil`/`false` values, which means these parameters: { "user" => nil } are transformed into this `params` hash: { "user" => { "user" => nil } } and `params["user"]` no longer returns the original parameter value.
* prepare for Minitest 6utilum2017-06-201-1/+1
|
* Define path with __dir__bogdanvlviv2017-05-2312-26/+26
| | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-24/+45
|
* Pass block in ActionController::Parameters#deleteEugene Kenny2017-05-101-0/+21
| | | | | | | | In order to fully support the same interface as `Hash#delete`, we need to pass the block through to the underlying method, not just the key. This used to work correctly, but it regressed when `ActionController::Parameters` stopped inheriting from `Hash` in 5.0.
* Add test case to make sure we can implicit convert a Parameters to a HashRafael Mendonça França2017-04-201-0/+7
|
* Reuse the Parameters#to_h check in the routing helpersRafael Mendonça França2017-04-182-3/+3
| | | | | Since this protection is now in Parameters we can use it instead of reimplementing again.
* Implement ActionController::Parameters#to_query and #to_paramRafael Mendonça França2017-04-181-3/+21
| | | | | | | | | | Previously it was raising an error because it may be unsafe to use those methods in a unpermitted parameter. Now we delegate to to_h that already raise an error when the Parameters instance is not permitted. This also fix a bug when using `#to_query` in a hash that contains a `ActionController::Parameters` instance and was returning the name of the class in the string.
* Use the right assetions to better error messagesRafael Mendonça França2017-04-181-7/+7
|