Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

CHttpCacheFilter failed to comply with RFC 2616 #1217

Merged
merged 3 commits into from

2 participants

@DaSourcerer

This is in response to #1192: According to sec. 10.3.5 ETag headers are to be sent among 304 responses, which the implementation in v1.1.11 didn't do. Pulling this PR should also close #1192.

@qiangxue qiangxue merged commit acfca6e into yiisoft:master
@qiangxue qiangxue was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +1 −0  CHANGELOG
  2. +3 −3 framework/web/filters/CHttpCacheFilter.php
View
1  CHANGELOG
@@ -14,6 +14,7 @@ Version 1.1.12 work in progress
- Bug #1094: CGridView with enabled history used to clear page title in case sorting or paging performed (Opera and Firefox only) (resurtm)
- Bug #1109: Fixed "js:" encoding BC-break in CHtml::ajax() and related methods introduced in 1.1.11 (samdark)
- Bug #1120: Fixed duplicate events processing in CGridView when ENTER was pressed for filtering (mdomba)
+- Bug #1192: CHttpCacheFilter failed to comply with RFC 2616, section 10.3.5 (DaSourcerer)
- Enh #243: CWebService is now able to deal with the customized WSDL generator classes, was hardcoded to the CWsdlGenerator before, added CWebService::$generatorConfig property (resurtm)
- Enh #636: CManyManyRelation now parses foreign key for the junction table data internally, and provide public interface to access it (klimov-paul)
- Chg #1099: Changed connectionId dropdown to sticky text field in Gii model generator (mdomba)
View
6 framework/web/filters/CHttpCacheFilter.php
@@ -64,6 +64,9 @@ public function preFilter($filterChain)
if($etag===false&&$lastModified===false)
return true;
+ if($etag)
+ header('ETag: '.$etag);
+
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])&&isset($_SERVER['HTTP_IF_NONE_MATCH']))
{
if($this->checkLastModified($lastModified)&&$this->checkEtag($etag))
@@ -96,9 +99,6 @@ public function preFilter($filterChain)
if($lastModified)
header('Last-Modified: '.date('r', $lastModified));
- if($etag)
- header('ETag: '.$etag);
-
$this->sendCacheControlHeader();
return true;
}
Something went wrong with that request. Please try again.