diff options
author | Johan Björk <johanimon@gmail.com> | 2014-08-28 00:10:31 +0200 |
---|---|---|
committer | Johan Björk <johanimon@gmail.com> | 2014-09-03 12:09:06 +0200 |
commit | dadb1fad2ab4c09a919fa65bb0fd4f89680d97b9 (patch) | |
tree | 2f285107f19dac99c825b774635795c76f8aa579 /apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php | |
parent | cb0da1178b0872988582ee5fbf6b5b1cb5ea2527 (diff) | |
download | nextcloud-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.php | 14 |
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); } } |