-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Fixed bug with purging of HTTPS URLs #22079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,6 +236,33 @@ public function testLocking() | |
$this->assertFalse($this->store->isLocked($req)); | ||
} | ||
|
||
public function testPurgeHttps() | ||
{ | ||
$request = Request::create('https://example.com/foo'); | ||
$this->store->write($request, new Response('foo')); | ||
|
||
$this->assertNotEmpty($this->getStoreMetadata($request)); | ||
|
||
$this->assertTrue($this->store->purge('https://example.com/foo')); | ||
$this->assertEmpty($this->getStoreMetadata($request)); | ||
} | ||
|
||
public function testPurgeHttpAndHttps() | ||
{ | ||
$requestHttp = Request::create('https://example.com/foo'); | ||
$this->store->write($requestHttp, new Response('foo')); | ||
|
||
$requestHttps = Request::create('http://example.com/foo'); | ||
$this->store->write($requestHttps, new Response('foo')); | ||
|
||
$this->assertNotEmpty($this->getStoreMetadata($requestHttp)); | ||
$this->assertNotEmpty($this->getStoreMetadata($requestHttps)); | ||
|
||
$this->assertTrue($this->store->purge('http://example.com/foo')); | ||
$this->assertEmpty($this->getStoreMetadata($requestHttp)); | ||
$this->assertEmpty($this->getStoreMetadata($requestHttps)); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Am I wrong or the non-regression test is missing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by non-regression test? I added two tests, one for each bug described in the initial issue comment. |
||
|
||
protected function storeSimpleEntry($path = null, $headers = array()) | ||
{ | ||
if (null === $path) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing this? The old version was better IMO as it doesn't execute the second purge if the one is properly done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the problem. Both versions of the cache entry – http AND https – should get purged. Before this change only the http version was purged.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. I was disturbed by the
:
change in the regex..