rails/actionpack/test
James Tucker 0b4e8c8d84 Ensure that cache-control headers are merged
There are several aspects to this commit, that don't well fit into broken down
commits, so they are detailed here:

 * When a user uses response.headers['Cache-Control'] = some_value, then the
   documented convention in ConditionalGet is not adhered to, in this case,
   response.cache_control is ignored due to `return if
   self[CACHE_CONTROL].present?`
 * When a middleware sets cache-control headers that would clobber, they're
   converted to symbols directly, without underscores. This would lead to bugs.
 * Items that would live in :extras if set through expires_in, are placed
   directly in the @cache_control hash, and not respected in many cases
   (somewhat adhering to the aforementioned documentation).
 * Although quite useless, any directive named 'extras' would be ignored.

The general convention applied is that expires_* take precedence, but no longer
overwrite everything and expires_* are ALWAYS applied, even if the header is
set.

I am still unhappy about the contents of this commit, and the code in general.
Ideally it should be refactored to no longer use :extras. I'd likely recommend
expanding @cache_control into a class, and giving it the power to handle the
merge in a more efficient fashion. Such a commit would be a larger change that
could have additional semantic changes for other libraries unless they utilize
expires_in in very standard ways.
2012-06-18 16:49:03 -07:00
..
abstract we raise a subclass of LoadError, so rescue that 2012-06-14 10:40:23 -07:00
activerecord Merge pull request #6588 from nbibler/polymorphic_to_model 2012-06-01 16:42:09 +02:00
assertions test response assertions 2012-01-06 11:20:26 -08:00
controller Ensure that cache-control headers are merged 2012-06-18 16:49:03 -07:00
dispatch Support unicode character route in config/routes.rb. 2012-06-16 00:22:16 +09:00
fixtures Respect absolute paths in compute_source_path. 2012-06-16 18:06:15 +02:00
lib/controller Add HTML5 input[type="color"] helper 2012-05-21 17:23:48 -03:00
metal ActionController::Caching depends on RackDelegation and AbstractController::Callbacks 2012-06-13 16:18:03 -03:00
routing add some tests, yay! 2012-02-22 11:05:03 -08:00
template Respect absolute paths in compute_source_path. 2012-06-16 18:06:15 +02:00
tmp
abstract_unit.rb Allow to use mounted helpers in ActionView::TestCase 2012-06-01 17:45:06 +02:00
active_record_unit.rb
ts_isolated.rb Don't use assert_block method. It will be deprecated. 2012-05-20 00:14:40 +09:00