-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Request::getPayload(): Return value must be of type InputBag, ParameterBag returned #47834
Comments
PS: it could be that the sentry/sentry-laravel is needed as well as that resolves the PSR request. |
this change break laravel, symfony/http-foundation@76002b1 |
same error here, after 10.16 update. |
quick workaround. add to composer.json |
same error, again, after 10.16 update. |
Can confirm this is happening for us too. |
Same error, confirming that downgrading had helped |
Same error here, the downgrade to |
Same error, fixed with |
Temporary fix for me was to require But also downgrading the recent Laravel updates:
I also had to delete the |
Could someone please provide the minimal steps to reproduce this? I've created a fresh install with breeze, installed Sending a request with Also, on first glace this looks like a Symfony issue rather than a Laravel issue? |
I don't have minimal steps, but here is a full stack trace:
Key points:
|
I can't repro when I use |
I don't have minimal steps, but I noticed it on a POST request trying to authenticate with a YubiKey using laravel-webauthn. Also on Laravel 9. |
I looked at this earlier to submit a PR, and wasn't sure how this would be resolved. It seemed to me (with minimal digging) that Symfony should return the parent class from getPayload() like you have suggested. The other thought I had was to override the getPayload() method in Illuminate's Request class. |
I've managed to replicate. Still investigating. |
I've found the issue. Putting together a PR to fix the issue. |
Thanks for the hard work @timacdonald 👏🏼 |
See: #47838 Would love someone to make this small change locally and confirm the fix gets you out of trouble. |
I made the change on 9.x and it fixed my issue with webauthn. |
Thank you, @jkuster |
@timacdonald, @taylorotwell this bug will be fixed for 9.x branch? |
See: #47840 |
Thanks for the quick fixes! 👍🏻 |
Laravel Version
10.16.0
PHP Version
8.1.19
Database Driver & Version
No response
Description
This error now occurs as soon as Laravel tries to handle any JSON request. This seems to be based on the new
symfony/psr-http-message-bridge
v2.3.0 release.But originally it seems like a far longer problem just never detected. With Symfony 6 types were added - so also to the
Symfony\Component\HttpFoundation\Request::getPayload()
method. But for Laravel 9 the payload of JSON requests was filled into aParameterBag
. All places not checking for explicit type won't have any problem as these classes have nearly identical APIs.Request::getPayload()
to populate the parsed body of PSR-7 requests symfony/psr-http-message-bridge#117framework/src/Illuminate/Http/Request.php
Lines 489 to 491 in 55ccc3a
Steps To Reproduce
Send a JSON request to the server with
"symfony/psr-http-message-bridge": "2.3.0"
installed.The text was updated successfully, but these errors were encountered: