aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | [ci skip] This modifies the HTTP Token authentication example's ↵Nick Malcolm2016-04-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | `authenticate` method, to use the `secure_compare` method with two constant-length strings. This defends against timing attacks, and is best practice. Using `==` for sensitive actions is not recommended, and this was the source of a CVE fixed in October 2015: https://github.com/rails/rails/commit/17e6f1507b7f2c2a883c180f4f9548445d6dfbda
* | | | | | Pass over all Rails 5 warnings, to make sure:Vipul A M2016-04-125-6/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - we are ending sentences properly - fixing of space issues - fixed continuity issues in some sentences. Reverts https://github.com/rails/rails/commit/8fc97d198ef31c1d7a4b9b849b96fc08a667fb02 . This change reverts making sure we add '.' at end of deprecation sentences. This is to keep sentences within Rails itself consistent and with a '.' at the end.
* | | | | quick edits on the AC::API RDoc [ci skip]Xavier Noria2016-04-051-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, the fact that ApplicationController is the only one inheriting from AC::API is not a default. You could say at most that generators generate them that way, but the creation of controllers is something which is out of our control because programmers write controllers by hand. Instead, we can say that normally, conventionally, as in the majority of Rails apps, that is the actually the case.
* | | | | it's => its typoRyan McCuaig2016-04-041-1/+1
| | | | |
* | | | | Fixes #24239Ryan T. Hosford2016-04-043-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | - skip calling helper_method if it's not there: if we don't have helpers, we needn't define one. - tests that an api controller can include and use ActionController::Cookies
* | | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2016-04-031-0/+7
|\ \ \ \ \
| * | | | | [ci skip] Fix example of ActionController::Parameters#to_unsafe_hPrathamesh Sonpatki2016-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Added missing `"`.
| * | | | | Add example for ActionController::Parameters#to_unsafe_hGaurish Sharma2016-03-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | [ci-skip]
* | | | | | Grammar fixes based on pass over ETag doc changesVipul A M2016-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | Grammer fix in comment: capitalize first word in sentence [ci skip].utilum2016-04-021-1/+1
| | | | | |
* | | | | | Strong ETag validatorsJeremy Daer2016-03-316-63/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Introduce `Response#strong_etag=` and `#weak_etag=` and analogous options for `fresh_when` and `stale?`. `Response#etag=` sets a weak ETag. Strong ETags are desirable when you're serving byte-for-byte identical responses that support Range requests, like PDFs or videos (typically done by reproxying the response from a backend storage service). Also desirable when fronted by some CDNs that support strong ETags only, like Akamai. * No longer strips quotes (`"`) from ETag values before comparing them. Quotes are significant, part of the ETag. A quoted ETag and an unquoted one are not the same entity. * Support `If-None-Match: *`. Rarely useful for GET requests; meant to provide some optimistic concurrency control for PUT requests.
* | | | | | Fix deprecation warning for ParamsParser instance :smile:Prathamesh Sonpatki2016-03-301-1/+1
| | | | | |
* | | | | | Deprecate ActionDispatch::ParamsParser instance.Rafael Mendonça França2016-03-302-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related with 38d2bf5fd1f3e014f2397898d371c339baa627b1. cc @tenderlove
* | | | | | Fix typo in headers commentGrey Baker2016-03-291-1/+1
| |/ / / / |/| | | |
* | | | | Fix typo in Action Pack changelog [ci skip]Prathamesh Sonpatki2016-03-251-1/+1
| | | | |
* | | | | Merge pull request #24037 from ↵Jeremy Daer2016-03-231-53/+34
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | jeremy/implicit-render-raises-on-browser-GET-requests-only Are you missing that template or did you omit it on purpose?
| * | | | | Refinement of our "are you missing a template or did you omit it on ↵Jeremy Daer2016-03-031-53/+34
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | purpose?" heuristics Narrows the "are you in a browser, viewing the page?" check to exclude non-GET requests. Allows content-less APIs to use implicit responses without having to set a fake request format. This will need further attention. If you forget to redirect from a POST to a GET, you'll get a 204 No Content response that browsers will typically treat as… do nothing. It'll seem like the form just didn't work and knowing where to start debugging is non-obvious. On the flip side, redirecting from POST and others is the default, done everywhere, so it's less likely to be removed or otherwise missed. Alternatives are to do more explicit browser sniffing. Ref #23827.
* | | | | Fix typo for redirect_backArkadiusz Fal2016-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | indetical -> identical [skip ci]
* | | | | guides, sync railties and AP changelogs with 5.0 release notes.Yves Senn2016-03-221-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] This updates the 5.0 release notes guide to reflect changes that happened after beta1 has been released. I'll sync the other changelogs later today but I'll push this batch to prevent against cumbersome merge conflicts.
* | | | | Fix request.reset_session for API controllersJon Moss2016-03-192-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Add explanation about accepts_nested_attributes_for keys in the strong ↵Bart de Water2016-03-121-2/+3
| | | | | | | | | | | | | | | | | | | | parameters documentation [skip ci]
* | | | | Break up a circular require between AP/AVSean Griffin2016-03-113-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now referencing the constant `AbstractController::Rendering` causes `ActionView::Base` to be loaded, and thus the load hooks for action_view are run. If that load hook references any part of action view that then references action controller (such as `ActionView::TestCase`), the constant `AbstractController::Rendering` will attempt to be autoloaded and blow up. With this change, `ActionView::LoadPaths` no longer requires `ActionView::Base` (which it had no reason to require). There was a needed class from `AbstractController::Base` in the Rendering module, which I've moved into its own file so we don't need to load all of `AbstractController::Base` there. This commit fixes https://github.com/rails/rails-controller-testing/issues/21
* | | | | Use the most highest priority exception handler when cause is setSean Griffin2016-03-112-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was some subtle breakage caused by #18774, when we removed `#original_exception` in favor of `#cause`. However, `#cause` is automatically set by Ruby when raising an exception from a rescue block. With this change, we will use whichever handler has the highest priority (whichever call to `rescue_from` came last). In cases where the outer has lower precidence than the cause, but the outer is what should be handled, cause will need to be explicitly unset. Fixes #23925
* | | | | Merge pull request #22854 from jcoyne/missing_templateSean Griffin2016-03-113-1/+23
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Default rendering behavior if respond_to collector doesn't have a block.
| * | | | | Render default template if block doesn't renderJustin Coyne2016-02-253-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a `respond_to` collector doesn't have a response, then a `:no_content` response should be rendered. This brings the default rendering behavior introduced by https://github.com/rails/rails/issues/19036 to controller methods employing `respond_to`
* | | | | | [skip ci] Reorder paragraphsDamir2016-03-101-3/+3
| | | | | | | | | | | | | | | | | | The previous order made sense [when `match` was used twice to point to two different actions](https://github.com/rails/rails/commit/7305ef842b675bf965f063de681a96294577fb84). In this case the note was misleading as posting to `/posts/:id` would still route to `show` action.
* | | | | | revises the homepage URL in the gemspecs [ci skip]Xavier Noria2016-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | References https://github.com/rails/homepage/issues/46.
* | | | | | add return values to example [ci skip]yuuji.yaginuma2016-03-101-1/+1
| | | | | |
* | | | | | Add `ActionController::Parameters#dig`Sean Griffin2016-03-093-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method will only be added when used with Ruby 2.3.0 or greater. This method has the same behavior as `Hash#dig`, except it will convert hashes to `ActionController::Parameters`, similar to `#[]` and `#fetch`.
* | | | | | Add changelog entry for #24115 [ci skip]Rafael Mendonça França2016-03-091-0/+5
| | | | | |
* | | | | | Pass headers through to payload for logging.Gareth du Plooy2016-03-082-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Make request headers available in the event payload so that it is available to attached ActionController::LogSubscribers.
* | | | | | extract ActionDispatch::IntegrationTest::BehaviorScott Bronson2016-03-071-22/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to 176fbfd6, this makes it possible for other test frameworks to hook into Rails integration test facilities.
* | | | | | Merge pull request #24086 from yui-knk/do_not_ad_integration_test_classYves Senn2016-03-072-0/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Prevent not-intended loading of `ActionDispatch::IntegrationTest`
| * | | | | | Prevent not-intended loading of `ActionDispatch::IntegrationTest`yui-knk2016-03-072-0/+7
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 9d378747326d26cf1afdac4433ead22967af0984 `ActionDispatch::IntegrationTest` class is loaded and defined in all Rails environments, not only test but also production. This is not-intended loading of a class which is only used in test environment. To prevent not-intended loading, add `ActiveSupport.run_load_hooks` to `ActionDispatch::IntegrationTest` with `action_dispatch_integration_test` name and use it in `ActionMailer`.
* | | | | | Merge pull request #24091 from mcfiredrill/fix-helper-method-docsRafael França2016-03-071-1/+2
|\ \ \ \ \ \ | |/ / / / / |/| | | | | clarify that helper_method makes both methods available in the view [ci skip]
| * | | | | clarify that helper_method makes both methods available in the viewTony Miller2016-03-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's probably obvious to most, but clarify that `:helper_method` will make both of these methods available to the view.
* | | | | | Remove http_cache_forever's version parameterJean Boussier2016-03-052-13/+3
| |_|/ / / |/| | | |
* | | | | [ci skip] Fix constrain_to documentation.Kasper Timm Hansen2016-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Forgot to update the documentation on the line just above the one I was changing in 4933132. Well done, Kasper :+1:
* | | | | Rename constrain_to to exclude.Kasper Timm Hansen2016-03-032-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActionDispatch::SSL` redirects all HTTP requests to HTTPS, not just some. The `constrain_to` option inverts this, so it sounds like the middleware only handles a few requests, rather than the majority with a few routes to opt out of the redirect. Renaming to `exclude` matches this intent more closely.
* | | | | Merge pull request #24027 from mechanicles/a-to-anXavier Noria2016-03-034-7/+7
|\ \ \ \ \ | |_|_|/ / |/| | | | Change 'a HTTP' to 'an HTTP' [ci skip]
| * | | | Change 'a HTTP' to 'an HTTP' [ci skip]Santosh Wadghule2016-03-034-7/+7
| | | | |
* | | | | Niceify the dynamic routes deprecation messagesJon Atack2016-03-031-2/+8
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up to #23980. - Fix grammar: "be remove" -> "be removed". - Wrap lines at 80 chars. Lurvely ;-)
* | | | Do not run app.executor callbacks in integration testsJorge Bejar and Santiago Pastorino2016-03-021-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts changes made to integration tests in PR #23807. The issue happens when using capybara with a driver that needs to start a server in a separate thread like (poltergeist, selenium, etc). Both threads the capybara server one and the test thread end running syncronize over the interlock.
* | | | Merge pull request #23999 from maxehmookau/patch-1Rafael França2016-03-021-1/+1
|\ \ \ \ | | | | | | | | | | Fix typo in implicit_render
| * | | | Fix typo in implicit_renderMax Woolf2016-03-021-1/+1
| | | | | | | | | | | | | | | When trying to make a request and the request doesn't have a suitable template, the new error messages are really helpful but there's a small (and I mean, VERY small) typo that has been bugging me for the last few days. This adds the space and restores order to the universe. :heart:
* | | | | [ci skip] Use rails routes instead of rake routes in inspector test descriptionAbhishek Jain2016-03-021-9/+9
|/ / / /
* | | | Merge pull request #23932 from arthurnn/arthurnn/remove_load_pathsArthur Nogueira Neves2016-03-011-2/+0
|\ \ \ \ | | | | | | | | | | Remove load_paths file
| * | | | Remove load_paths fileArthur Neves2016-02-271-2/+0
| | | | |
* | | | | Merge pull request #23980 from rails/deprecate-controller-action-segmentsAndrew White2016-03-0131-212/+477
|\ \ \ \ \ | | | | | | | | | | | | Deprecate :controller and :action path parameters
| * | | | | Deprecate :controller and :action path parametersAndrew White2016-03-0131-212/+477
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allowing :controller and :action values to be specified via the path in config/routes.rb has been an underlying cause of a number of issues in Rails that have resulted in security releases. In light of this it's better that controllers and actions are explicitly whitelisted rather than trying to blacklist or sanitize 'bad' values.