- No changes.
- No changes.
- No changes.
-
Check exclude before flagging cookies as secure.
Catherine Khuu
-
Fix optimized url helpers when using relative url root
Fixes #31220.
Andrew White
-
Ensure dev and prod puma configs do not clobber
ActionDispatch::SystemTestingdefaults. Adds workers: 0 and daemon: falseMax Schwenk
-
Make
take_failed_screenshotwork within engine.Fixes #30405.
Yuji Yaginuma
- No changes.
- No changes.
- No changes.
- No changes.
- No changes.
-
Fallback
ActionController::Parameters#to_stoHash#to_s.Kir Shatrov
-
driven_bynow registers poltergeist and capybara-webkitIf driver poltergeist or capybara-webkit is set for System Tests,
driven_bywill register the driver and set additional options passed via:optionsparam.Refer to drivers documentation to learn what options can be passed.
Mario Chavez
- No changes.
-
Raise exception when calling
to_handto_hashin an unpermitted Parameters.Before we returned either an empty hash or only the always permitted parameters (
:controllerand:actionby default).The previous behavior was dangerous because in order to get the attributes users usually fallback to use
to_unsafe_h thatcould potentially introduce security issues.Rafael Mendonça França
-
Deprecate
config.action_controller.raise_on_unfiltered_parameters.This option has no effect in Rails 5.1.
Rafael Mendonça França
-
Use more specific check for :format in route path
The current check for whether to add an optional format to the path is very lax and will match things like
:format_idwhere there are nested resources, e.g:resources :formats do resources :items end
Fix this by using a more restrictive regex pattern that looks for the patterns
(.:format),.:formator/at the end of the path. Note that we need to allow for multiple closing parenthesis since the route may be of this form:get "/books(/:action(.:format))", controller: "books"
This probably isn't what's intended since it means that the default index action route doesn't support a format but we have a test for it so we need to allow it.
Fixes #28517.
Andrew White
-
Add
action_controller_apiandaction_controller_baseload hooks to be called inActiveSupport.on_loadActionController::BaseandActionController::APIhave differing implementations. This means that the one umbrella hookaction_controlleris not able to address certain situations where a method may not exist in a certain implementation.This is fixed by adding two new hooks so you can target
ActionController::BasevsActionController::APIFixes #27013.
Julian Nadeau
-
Don't include default headers in
ActionController::MetalresponsesThe commit e16afe6 introduced an unintentional change of behavior where the default headers were included in responses from
ActionController::Metalbased controllers. This is now reverted to the previous behavior of having no default headers.Fixes #25820.
Jon Moss
-
Fix
NameErrorraised inActionController::Renderer#with_defaultsHiroyuki Ishii
-
Added
#reverse_mergeand#reverse_merge!methods toActionController::ParametersEdouard Chin, Mitsutaka Mimura
-
Fix malformed URLS when using
ApplicationController.rendererThe Rack environment variable
rack.url_schemewas not being set soschemewas returningnil. This caused URLs to be malformed with the default settings. Fix this by settingrack.url_schemewhen the environment is normalized.Fixes #28151.
George Vrettos
-
Commit flash changes when using a redirect route.
Fixes #27992.
Andrew White
-
Prefer
remove_methodoverundef_methodwhen reloading routesWhen
undef_methodis used it prevents access to other implementations of that url helper in the ancestor chain so useremove_methodinstead to restore access.Andrew White
-
Add the
resolvemethod to the routing DSLThis new method allows customization of the polymorphic mapping of models:
resource :basket resolve("Basket") { [:basket] }
<%= form_for @basket do |form| %> <!-- basket form --> <% end %>
This generates the correct singular URL for the form instead of the default resources member url, e.g.
/basketvs./basket/:id.Fixes #1769.
Andrew White
-
Add the
directmethod to the routing DSLThis new method allows creation of custom url helpers, e.g:
direct(:apple) { "http://www.apple.com" } >> apple_url => "http://www.apple.com"
This has the advantage of being available everywhere url helpers are available unlike custom url helpers defined in helper modules, etc.
Andrew White
-
Add
ActionDispatch::SystemTestCaseto Action PackAdds Capybara integration directly into Rails through Action Pack!
See PR #26703
Eileen M. Uchitelle
-
Remove deprecated
.to_prepare,.to_cleanup,.prepare!and.cleanup!fromActionDispatch::Reloader.Rafael Mendonça França
-
Remove deprecated
ActionDispatch::Callbacks.to_prepareandActionDispatch::Callbacks.to_cleanup.Rafael Mendonça França
-
Remove deprecated
ActionController::Metal.call.Rafael Mendonça França
-
Remove deprecated
ActionController::Metal#env.Rafael Mendonça França
-
Make
with_routingtest helper work when testing controllers inheriting fromActionController::APIJulia López
-
Use accept header in integration tests with
as: :jsonInstead of appending the
formatto the request path, Rails will figure out the format from the header instead.This allows devs to use
:ason routes that don't have a format.Fixes #27144.
Kasper Timm Hansen
-
Reset a new session directly after its creation in
ActionDispatch::IntegrationTest#open_session.Fixes #22742.
Tawan Sierek
-
Fixes incorrect output from
rails routeswhen using singular resources.Fixes #26606.
Erick Reyna
-
Fixes multiple calls to
logger.fatalinstead of a single call, for every line in an exception backtrace, when printing trace fromDebugExceptionsmiddleware.Fixes #26134.
Vipul A M
-
Add support for arbitrary hashes in strong parameters:
params.permit(preferences: {})
Xavier Noria
-
Add
ActionController::Parameters#merge!, which behaves the same asHash#merge!.Yuji Yaginuma
-
Allow keys not found in
RACK_KEY_TRANSLATIONfor setting the environment when rendering arbitrary templates.Sammy Larbi
-
Remove deprecated support to non-keyword arguments in
ActionDispatch::IntegrationTest#process,#get,#post,#patch,#put,#delete, and#head.Rafael Mendonça França
-
Remove deprecated
ActionDispatch::IntegrationTest#*_via_redirect.Rafael Mendonça França
-
Remove deprecated
ActionDispatch::IntegrationTest#xml_http_request.Rafael Mendonça França
-
Remove deprecated support for passing
:pathand route path as strings inActionDispatch::Routing::Mapper#match.Rafael Mendonça França
-
Remove deprecated support for passing path as
nilinActionDispatch::Routing::Mapper#match.Rafael Mendonça França
-
Remove deprecated
cache_controlargument fromActionDispatch::Static#initialize.Rafael Mendonça França
-
Remove deprecated support to passing strings or symbols to the middleware stack.
Rafael Mendonça França
-
Change HSTS subdomain to true.
Rafael Mendonça França
-
Remove deprecated
hostandportssl options.Rafael Mendonça França
-
Remove deprecated
const_errorargument inActionDispatch::Session::SessionRestoreError#initialize.Rafael Mendonça França
-
Remove deprecated
#original_exceptioninActionDispatch::Session::SessionRestoreError.Rafael Mendonça França
-
Deprecate
ActionDispatch::ParamsParser::ParseErrorin favor ofActionDispatch::Http::Parameters::ParseError.Rafael Mendonça França
-
Remove deprecated
ActionDispatch::ParamsParser.Rafael Mendonça França
-
Remove deprecated
original_exceptionandmessagearguments inActionDispatch::ParamsParser::ParseError#initialize.Rafael Mendonça França
-
Remove deprecated
#original_exceptioninActionDispatch::ParamsParser::ParseError.Rafael Mendonça França
-
Remove deprecated access to mime types through constants.
Rafael Mendonça França
-
Remove deprecated support to non-keyword arguments in
ActionController::TestCase#process,#get,#post,#patch,#put,#delete, and#head.Rafael Mendonça França
-
Remove deprecated
xml_http_requestandxhrmethods inActionController::TestCase.Rafael Mendonça França
-
Remove deprecated methods in
ActionController::Parameters.Rafael Mendonça França
-
Remove deprecated support to comparing a
ActionController::Parameterswith aHash.Rafael Mendonça França
-
Remove deprecated support to
:textinrender.Rafael Mendonça França
-
Remove deprecated support to
:nothinginrender.Rafael Mendonça França
-
Remove deprecated support to
:backinredirect_to.Rafael Mendonça França
-
Remove deprecated support to passing status as option
head.Rafael Mendonça França
-
Remove deprecated support to passing original exception to
ActionController::BadRequestand theActionController::BadRequest#original_exceptionmethod.Rafael Mendonça França
-
Remove deprecated methods
skip_action_callback,skip_filter,before_filter,prepend_before_filter,skip_before_filter,append_before_filter,around_filterprepend_around_filter,skip_around_filter,append_around_filter,after_filter,prepend_after_filter,skip_after_filterandappend_after_filter.Rafael Mendonça França
-
Show an "unmatched constraints" error when params fail to match constraints on a matched route, rather than a "missing keys" error.
Fixes #26470.
Chris Carter
-
Fix adding implicitly rendered template digests to ETags.
Fixes a case when modifying an implicitly rendered template for a controller action using
fresh_whenorstale?would not result in a newETagvalue.Javan Makhmali
-
Make
fixture_file_uploadwork in integration tests.Yuji Yaginuma
-
Add
to_paramtoActionController::Parametersdeprecations.In the future
ActionController::Parametersare discouraged from being used in URLs without explicit whitelisting. Go throughto_hto useto_param.Kir Shatrov
-
Fix nested multiple roots
The PR #20940 enabled the use of multiple roots with different constraints at the top level but unfortunately didn't work when those roots were inside a namespace and also broke the use of root inside a namespace after a top level root was defined because the check for the existence of the named route used the global :root name and not the namespaced name.
This is fixed by using the name_for_action method to expand the :root name to the full namespaced name. We can pass nil for the second argument as we're not dealing with resource definitions so don't need to handle the cases for edit and new routes.
Fixes #26148.
Ryo Hashimoto, Andrew White
-
Include the content of the flash in the auto-generated etag. This solves the following problem:
- POST /messages
- redirect_to messages_url, notice: 'Message was created'
- GET /messages/1
- GET /messages
Step 4 would before still include the flash message, even though it's no longer relevant, because the etag cache was recorded with the flash in place and didn't change when it was gone.
DHH
-
SSL: Changes redirect behavior for all non-GET and non-HEAD requests (like POST/PUT/PATCH etc) to
http://resources to redirect tohttps://with a 307 status code instead of 301 status code.307 status code instructs the HTTP clients to preserve the original request method while redirecting. It has been part of HTTP RFC since 1999 and is implemented/recognized by most (if not all) user agents.
# Before POST http://example.com/articles (i.e. ArticlesContoller#create) redirects to GET https://example.com/articles (i.e. ArticlesContoller#index) # After POST http://example.com/articles (i.e. ArticlesContoller#create) redirects to POST https://example.com/articles (i.e. ArticlesContoller#create)Chirag Singhal
-
Add
:asoption toActionController:TestCase#processand related methods.Specifying
as: mime_typeallows theCONTENT_TYPEheader to be specified in controller tests without manually doing this through@request.headers['CONTENT_TYPE'].Everest Stefan Munro-Zeisberger
-
Show cache hits and misses when rendering partials.
Partials using the
cachehelper will show whether a render hit or missed the cache:Rendered messages/_message.html.erb in 1.2 ms [cache hit] Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]This removes the need for the old fragment cache logging:
Read fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/d0bdf2974e1ef6d31685c3b392ad0b74 (0.6ms) Rendered messages/_message.html.erb in 1.2 ms [cache hit] Write fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/3b4e249ac9d168c617e32e84b99218b5 (1.1ms) Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]Though that full output can be reenabled with
config.action_controller.enable_fragment_cache_logging = true.Stan Lo
-
Don't override the
Acceptheader in integration tests when called withxhr: true.Fixes #25859.
David Chen
-
Fix
defaultsoption for root route.A regression from some refactoring for the 5.0 release, this change fixes the use of
defaults(default parameters) in therootrouting method.Chris Arcand
-
Check
request.path_parametersencoding at the point they're set.Check for any non-UTF8 characters in path parameters at the point they're set in
env. Previously they were checked for when used to get a controller class, but this meant routes that went directly to a Rack app, or skipped controller instantiation for some other reason, had to defend against non-UTF8 characters themselves.Grey Baker
-
Don't raise
ActionController::UnknownHttpMethodfromActionDispatch::Static.Pass
Rack::Requestobjects toActionDispatch::FileHandlerto avoid it raisingActionController::UnknownHttpMethod. If an unknown method is passed, it should pass exception higher in the stack instead, once we've had a chance to define exception handling behaviour.Grey Baker
-
Handle
Rack::QueryParsererrors inActionDispatch::ExceptionWrapper.Updated
ActionDispatch::ExceptionWrapperto handle the Rack 2.0 namespace forParameterTypeErrorandInvalidParameterErrorerrors.Grey Baker
Please check 5-0-stable for previous changes.