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] FixCacheAttributeListener priority#48524

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

Conversation

HypeMC
Copy link
Member

@HypeMCHypeMC commentedDec 6, 2022
edited
Loading

QA
Branch?6.2
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

Currently theCacheAttributeListener & theIsGrantedAttributeListener have the same priority:

Registered Listeners for "kernel.controller_arguments" Event============================================================ ------- --------------------------------------------------------------------------------------------------------- ----------   Order   Callable                                                                                                  Priority   ------- --------------------------------------------------------------------------------------------------------- ----------   #1      Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments()          10          #2      Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments()   10          #3      Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments()                         0          ------- --------------------------------------------------------------------------------------------------------- ----------

Since theCacheAttributeListener is alphabetically first, it's first to get triggered. This can cause an unauthenticated user to receive a 304 Not modified instead of a 302 Redirect, resulting in the user seeing some stale content from when they were authenticated instead of getting redirected to the login page.

This PR changes the priority of theCacheAttributeListener to be lower than that of theIsGrantedAttributeListener.

@carsonbotcarsonbot added this to the6.2 milestoneDec 6, 2022
@HypeMCHypeMC changed the title[HttpKernel] Fix CacheAttributeListener priority[HttpKernel] FixCacheAttributeListener priorityDec 6, 2022
@nicolas-grekas
Copy link
Member

Did you consider setting IsGrantedAttributeListener's priority to 20 instead?

@HypeMCHypeMCforce-pushed thecacheattributelistener-priority-fix branch from282eef4 to90eb89fCompareDecember 13, 2022 15:05
@HypeMC
Copy link
MemberAuthor

@nicolas-grekas Actually, come to think of it, I'd prefer that option,done.

@nicolas-grekas
Copy link
Member

Thank you@HypeMC.

@nicolas-grekasnicolas-grekas merged commit0f5a556 intosymfony:6.2Dec 13, 2022
@HypeMCHypeMC deleted the cacheattributelistener-priority-fix branchDecember 13, 2022 15:54
@fabpotfabpot mentioned this pull requestDec 16, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@wouterjwouterjAwaiting requested review from wouterjwouterj is a code owner

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
6.2
Development

Successfully merging this pull request may close these issues.

3 participants
@HypeMC@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp