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

[6.x] Convert Responsables to Response objects in VerifyCsrfToken #29972

Conversation

@sebastiandedeyne
Copy link
Contributor

commented Sep 12, 2019

When VerifyCsrfToken tries to add cookies to a Responsable object, it triggers an error that the headers property is undefined.

The underlying problem is that if the Responsable hasn't been transformed to a response yet, the $headers doesn't necessarily exist.

This PR adds an instanceof check to the $response variable. If it's a Responsable, it will transform it to a Response object first.

Closes #29845

@driesvints

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

@sebastiandedeyne you might want to add an explanation why this is needed instead of linking to an issue. Otherwise your pr will probably be closed.

@driesvints driesvints changed the title Convert Responsables to Response objects in VerifyCsrfToken [6.x] Convert Responsables to Response objects in VerifyCsrfToken Sep 12, 2019
@sebastiandedeyne

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2019

Sorry, updated the description!

@taylorotwell taylorotwell merged commit 1235dcf into laravel:6.x Sep 12, 2019
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.