Skip to content
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

only set the master request on request_aware services #55

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions EventListener/RequestAwareListener.php
Expand Up @@ -23,6 +23,10 @@ class RequestAwareListener implements EventSubscriberInterface

public function onKernelRequest(GetResponseEvent $event)
{
if ($event->getRequestType() !== HttpKernelInterface::MASTER_REQUEST) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@lunetics additionally checks for the request being xmlhttprequest - not sure why as i would expect an ajax request to be considered a master request too. https://github.com/lunetics/LocaleBundle/blob/master/EventListener/LocaleListener.php#L93

return;
}

foreach ($this->services as $service) {
$service->setRequest($event->getRequest());
}
Expand Down