This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/HttpKernel/HttpCache
Jason Desrosiers 532160026f Fixed two bugs in HttpCache
1. 304 responses always send "Content-Type: text/html; charset=UTF-8"
header
I discovered that the HttpCache::handle method calls Response::prepare
after calling Response::isModified.  Response::isModified removes the
Content-Type header as it should, but Response::handle adds in the
default Content-Type header when none is set.  If the default
Content-Type is not the correct Content-Type, then the Content-Type in
the cache gets clobered.  I solved this problem by moving the
Response::isModified call after the Response::prepare call.  I updated
the testRespondsWith304WhenIfModifiedSinceMatchesLastModified and
testRespondsWith304WhenIfNoneMatchMatchesETag tests to verify that the
Content-Type header was not being sent for 304 responses.

2. Failure to invalidate cached entities referred to by the Location
header
I discovered that the Store::invalidate method was looking for Location
and Content-Location headers to invalidate, but it was looking in the
request headers instead of the response headers.  Because the
Store::invalidate method doesn't take a response, I decided it was
better to move this logic to the HttpCache::invalidate method instead.
I updated the testInvalidatesCachedResponsesOnPost test to verify that
Location headers are getting invalidated correctly.
2013-05-21 00:25:38 +02:00
..
Esi.php merged 2.0 2012-02-04 08:03:45 +01:00
EsiResponseCacheStrategy.php remove validation related headers when needed 2013-05-01 06:14:15 +02:00
EsiResponseCacheStrategyInterface.php fixed CS 2012-07-09 14:54:20 +02:00
HttpCache.php Fixed two bugs in HttpCache 2013-05-21 00:25:38 +02:00
Store.php Fixed two bugs in HttpCache 2013-05-21 00:25:38 +02:00
StoreInterface.php Add check to Store::unlock to ensure file exists 2012-08-29 16:45:40 +10:00