Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
9a68678d
Commit
9a68678d
authored
Aug 16, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional fix to #4728.
parent
45dbbc39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
HttpCache.php
framework/filters/HttpCache.php
+2
-2
HttpCacheTest.php
tests/unit/framework/filters/HttpCacheTest.php
+1
-1
No files found.
framework/filters/HttpCache.php
View file @
9a68678d
...
@@ -152,9 +152,9 @@ class HttpCache extends ActionFilter
...
@@ -152,9 +152,9 @@ class HttpCache extends ActionFilter
if
(
isset
(
$_SERVER
[
'HTTP_IF_NONE_MATCH'
]))
{
if
(
isset
(
$_SERVER
[
'HTTP_IF_NONE_MATCH'
]))
{
// HTTP_IF_NONE_MATCH takes precedence over HTTP_IF_MODIFIED_SINCE
// HTTP_IF_NONE_MATCH takes precedence over HTTP_IF_MODIFIED_SINCE
// http://tools.ietf.org/html/rfc7232#section-3.3
// http://tools.ietf.org/html/rfc7232#section-3.3
return
$etag
===
null
||
in_array
(
$etag
,
Yii
::
$app
->
request
->
getEtags
(),
true
);
return
$etag
!==
null
&&
in_array
(
$etag
,
Yii
::
$app
->
request
->
getEtags
(),
true
);
}
elseif
(
isset
(
$_SERVER
[
'HTTP_IF_MODIFIED_SINCE'
]))
{
}
elseif
(
isset
(
$_SERVER
[
'HTTP_IF_MODIFIED_SINCE'
]))
{
return
$lastModified
===
null
||
@
strtotime
(
$_SERVER
[
'HTTP_IF_MODIFIED_SINCE'
])
>=
$lastModified
;
return
$lastModified
!==
null
&&
@
strtotime
(
$_SERVER
[
'HTTP_IF_MODIFIED_SINCE'
])
>=
$lastModified
;
}
else
{
}
else
{
return
$etag
===
null
&&
$lastModified
===
null
;
return
$etag
===
null
&&
$lastModified
===
null
;
}
}
...
...
tests/unit/framework/filters/HttpCacheTest.php
View file @
9a68678d
...
@@ -51,7 +51,7 @@ class HttpCacheTest extends \yiiunit\TestCase
...
@@ -51,7 +51,7 @@ class HttpCacheTest extends \yiiunit\TestCase
$this
->
assertFalse
(
$method
->
invoke
(
$httpCache
,
0
,
'"foos"'
));
$this
->
assertFalse
(
$method
->
invoke
(
$httpCache
,
0
,
'"foos"'
));
$this
->
assertTrue
(
$method
->
invoke
(
$httpCache
,
1
,
'"foo"'
));
$this
->
assertTrue
(
$method
->
invoke
(
$httpCache
,
1
,
'"foo"'
));
$this
->
assertFalse
(
$method
->
invoke
(
$httpCache
,
1
,
'"foos"'
));
$this
->
assertFalse
(
$method
->
invoke
(
$httpCache
,
1
,
'"foos"'
));
$this
->
assert
Tru
e
(
$method
->
invoke
(
$httpCache
,
null
,
null
));
$this
->
assert
Fals
e
(
$method
->
invoke
(
$httpCache
,
null
,
null
));
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment