Closed L3o-pold closed 7 months ago
2.3.5
11.0.7
8.3.4
Swoole
5.1.1 and 5.1.2
No response
Since Laravel 11 executing a PUT request with a Content-Type: application/x-www-form-urlencoded header result in a 500 error.
PUT
Content-Type: application/x-www-form-urlencoded
It occurs with PUT or DELETE method (not POST).
DELETE
POST
Using Laravel 11 and Octane (Swoole server)
Route::put('/api/test', function () { return response('OK'); });
curl --location --fail --request PUT 'http://0.0.0.0/api/test' --header 'Content-Type: application/x-www-form-urlencoded' curl: (22) The requested URL returned error: 500
Error logs (using sail)
laravel.test-1 | PHP Fatal error: Uncaught TypeError: Cannot assign Symfony\Component\HttpFoundation\ParameterBag to property Symfony\Component\HttpFoundation\Request::$request of type Symfony\Component\HttpFoundation\InputBag in /var/www/html/vendor/laravel/octane/src/Swoole/Actions/ConvertSwooleRequestToIlluminateRequest.php:38 laravel.test-1 | Stack trace: laravel.test-1 | #0 /var/www/html/vendor/laravel/octane/src/Swoole/SwooleClient.php(40): Laravel\Octane\Swoole\Actions\ConvertSwooleRequestToIlluminateRequest->__invoke() laravel.test-1 | #1 /var/www/html/vendor/laravel/octane/bin/swoole-server(120): Laravel\Octane\Swoole\SwooleClient->marshalRequest() laravel.test-1 | #2 [internal function]: {closure}() laravel.test-1 | #3 /var/www/html/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start() laravel.test-1 | #4 {main} laravel.test-1 | thrown in /var/www/html/vendor/laravel/octane/src/Swoole/Actions/ConvertSwooleRequestToIlluminateRequest.php on line 38
Thanks @L3o-pold. Seems @sy-records has already sent in a PR.
Octane Version
2.3.5
Laravel Version
11.0.7
PHP Version
8.3.4
What server type are you using?
Swoole
Server Version
5.1.1 and 5.1.2
Database Driver & Version
No response
Description
Since Laravel 11 executing a
PUT
request with aContent-Type: application/x-www-form-urlencoded
header result in a 500 error.It occurs with
PUT
orDELETE
method (notPOST
).Steps To Reproduce
Using Laravel 11 and Octane (Swoole server)
Error logs (using sail)