Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ausi wants to merge2 commits intosymfony:2.7fromausi:fix/http-cache-purge

Conversation

@ausi
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

I found two bugs inHttpCache\Store::purge() with HTTPS URLs:

  1. ->purge('https://example.com/') only purges thehttp version not thehttps one.
  2. If a cache entry exists for bothhttp andhttps, only thehttp version gets purged, thehttps version stays in the cache.

I think this issues were introduced with#21582.

This pull request fixes both issues and adds tests for them.

@fabpot
Copy link
Member

LGTM.

ausi reacted with hooray emoji

$purgedHttp =$this->doPurge($http);
$purgedHttps =$this->doPurge($https);

return$purgedHttp ||$purgedHttps;
Copy link
Contributor

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.

Copy link
ContributorAuthor

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.

Nek- reacted with thumbs up emoji
Copy link
Contributor

@Nek-Nek-Mar 20, 2017
edited
Loading

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..

$this->assertTrue($this->store->purge('http://example.com/foo'));
$this->assertEmpty($this->getStoreMetadata($requestHttp));
$this->assertEmpty($this->getStoreMetadata($requestHttps));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Am I wrong or the non-regression test is missing?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The 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.

Nek- reacted with thumbs up emoji
@fabpot
Copy link
Member

Thank you@ausi.

fabpot added a commit that referenced this pull requestMar 21, 2017
This PR was squashed before being merged into the 2.7 branch (closes#22079).Discussion----------[HttpKernel] Fixed bug with purging of HTTPS URLs| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |I found two bugs in `HttpCache\Store::purge()` with HTTPS URLs:1. `->purge('https://example.com/')` only purges the `http` version not the `https` one.2. If a cache entry exists for both `http` and `https`, only the `http` version gets purged, the `https` version stays in the cache.I think this issues were introduced with#21582.This pull request fixes both issues and adds tests for them.Commits-------f509150 [HttpKernel] Fixed bug with purging of HTTPS URLs
@fabpotfabpot closed thisMar 21, 2017
This was referencedApr 4, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@Nek-Nek-Nek- approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@ausi@fabpot@Nek-@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp