From dadb1fad2ab4c09a919fa65bb0fd4f89680d97b9 Mon Sep 17 00:00:00 2001 From: Johan Björk Date: Thu, 28 Aug 2014 00:10:31 +0200 Subject: Update AWS sdk to 2.6.15 --- .../Guzzle/Plugin/Cache/DefaultRevalidation.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/files_external/3rdparty/aws-sdk-php/Guzzle/Plugin/Cache/DefaultRevalidation.php') 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); } } -- cgit v1.2.3