aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php
diff options
context:
space:
mode:
authorJohan Björk <johanimon@gmail.com>2014-08-28 00:10:31 +0200
committerJohan Björk <johanimon@gmail.com>2014-09-03 12:09:06 +0200
commitdadb1fad2ab4c09a919fa65bb0fd4f89680d97b9 (patch)
tree2f285107f19dac99c825b774635795c76f8aa579 /apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php
parentcb0da1178b0872988582ee5fbf6b5b1cb5ea2527 (diff)
downloadnextcloud-server-dadb1fad2ab4c09a919fa65bb0fd4f89680d97b9.tar.gz
nextcloud-server-dadb1fad2ab4c09a919fa65bb0fd4f89680d97b9.zip
Update AWS sdk to 2.6.15
Diffstat (limited to 'apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php')
-rw-r--r--apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php
index 1bbaa1ad0fc..af33234eef8 100644
--- a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php
+++ b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php
@@ -60,7 +60,7 @@ class DefaultRevalidation implements RevalidationInterface
($resCache && ($resCache->hasDirective('no-cache') || $resCache->hasDirective('must-revalidate')));
// Use the strong ETag validator if available and the response contains no Cache-Control directive
- if (!$revalidate && !$reqCache && $response->hasHeader('ETag')) {
+ if (!$revalidate && !$resCache && $response->hasHeader('ETag')) {
$revalidate = true;
}
@@ -95,19 +95,21 @@ class DefaultRevalidation implements RevalidationInterface
protected function createRevalidationRequest(RequestInterface $request, Response $response)
{
$revalidate = clone $request;
- $revalidate->removeHeader('Pragma')
- ->removeHeader('Cache-Control')
- ->setHeader('If-Modified-Since', $response->getLastModified() ?: $response->getDate());
+ $revalidate->removeHeader('Pragma')->removeHeader('Cache-Control');
+
+ if ($response->getLastModified()) {
+ $revalidate->setHeader('If-Modified-Since', $response->getLastModified());
+ }
if ($response->getEtag()) {
- $revalidate->setHeader('If-None-Match', '"' . $response->getEtag() . '"');
+ $revalidate->setHeader('If-None-Match', $response->getEtag());
}
// Remove any cache plugins that might be on the request to prevent infinite recursive revalidations
$dispatcher = $revalidate->getEventDispatcher();
foreach ($dispatcher->getListeners() as $eventName => $listeners) {
foreach ($listeners as $listener) {
- if ($listener[0] instanceof CachePlugin) {
+ if (is_array($listener) && $listener[0] instanceof CachePlugin) {
$dispatcher->removeListener($eventName, $listener);
}
}