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
Fix handling ESI request #213
Conversation
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.
Thanks for reporting this! Can you add a test to avoid having regressions with this bug?
Sorry, I should have done it in the first place 😬 |
if (! $event->getRequest()->attributes->has('_route')) { | ||
return; | ||
} | ||
|
||
$matchedRoute = $event->getRequest()->attributes->get('_route'); |
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.
I was thinking that $matchRoute
must be a string
because Scope::setTag
is typed with string
and $event->getRequest()->attributes->get('_route')
returns mixed
, so maybe there should be a cast in here? just to make sure it doesn't fail.
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.
Since that depends on Symfony, we can count in it being a string, but a cast doesn't hurt, yeah.
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.
done 😬
Hi!
When the RequestListener is handling a ESI request it fails because it has no
_route
defined in its attributes and it returnsnull
, so theScope:: setTag
method fails because is expecting astring
.