-
-
Notifications
You must be signed in to change notification settings - Fork 918
Fix test since last Symfony Release #2043
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
Conversation
12ec35c
to
415237d
Compare
@@ -72,5 +73,7 @@ public function onKernelResponse(FilterResponseEvent $event) | |||
if (null !== $this->public) { | |||
$this->public ? $response->setPublic() : $response->setPrivate(); | |||
} | |||
|
|||
$response->headers->set(SessionListener::NO_AUTO_CACHE_CONTROL_HEADER, ''); |
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.
It's almost good, just add an isset
check before using the constant.
Uhh, you beat me to it. 😂 |
I don't get why php 7 is failing... Locally the same behat test is successful. |
I currently test that locally ;)
Le mar. 26 juin 2018 à 10:32, Antoine Bluchet <notifications@github.com> a
écrit :
… I don't get why php 7 is failing... Locally the same behat test is
successful.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2043 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAc1bZ0X9bxhQmv-qAs0Vb9s7PYTaUrtks5uAfGkgaJpZM4U3AGN>
.
|
As I've discussed with @jewome62, there's no good fix for this now. So let's wait for this to be sorted out in Symfony. |
There is a good fix (for our test suite at least). The problem belongs here: https://github.com/api-platform/core/blob/master/tests/Fixtures/app/AppKernel.php#L117 When routes are secured, Symfony starts a session, and when a session is started, the cache is disabled by default. It looks like a sensitive default to me. We need to do 2 different things:
|
I'm inclined to think disabling access control falls into the "not a real fix" category. |
Why? It would be more correct on our side (the resources served by our test app are public and don't vary depending of the logged in user, so the security must be disabled). |
Well, yes, it's okay for our case. But it's still bad for other apps, including apps using API Platform. Something needs to be done in Symfony. |
Anyway, I forgot about this, but the session seems to be started by Symfony itself: https://github.com/symfony/symfony/blob/2b9c142f07b7dbc11d4d392b77629fa91a5dcb41/src/Symfony/Component/HttpKernel/EventListener/AbstractTestSessionListener.php#L74 |
Let's fix our test suite then. Symfony bugs must be fixed on the SF repo. |
We can't :D. |
Indeed we can't. We just have to skip that test for now. |
Fail since 4.1.1 : for this commi : symfony/symfony@146e01c
The test don't work for PHP 7.0 and Symfony before 3 month ago. ( because NO_AUTO_CACHE_CONTROL_HEADER is implemented on March 2018)
I don't know if this is a bug which need to be fix on Symfony