mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-24 18:13:00 +01:00
Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable.
This commit is contained in:
parent
5b597ce24c
commit
2529aaa3b1
@ -794,11 +794,6 @@ class Response extends AbstractMessage
|
||||
return false;
|
||||
}
|
||||
|
||||
// HTTPS responses must send a Cache-Control: public value for caching
|
||||
if ($this->getRequest() && $this->getRequest()->getScheme() == 'https' && !$this->hasCacheControlDirective('public')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
|
||||
}
|
||||
|
||||
|
@ -666,17 +666,6 @@ class ResponseTest extends \Guzzle\Tests\GuzzleTestCase
|
||||
'Content-Length' => 0
|
||||
)), EntityBody::factory($resource, 0))->canCache());
|
||||
unlink($tmp);
|
||||
|
||||
// When an HTTPS request is sent and the Cache-Control directive does
|
||||
// not include a 'public' value, then the response is not to be cached
|
||||
$request = RequestFactory::getInstance()->create('GET', 'https://www.test.com/');
|
||||
$response = new Response(200);
|
||||
$response->setRequest($request);
|
||||
$this->assertFalse($response->canCache());
|
||||
|
||||
// This response can be cache because it is public
|
||||
$response->setHeader('Cache-Control', 'public');
|
||||
$this->assertTrue($response->canCache());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user