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

Fatal error with Swoole on a PUT request with application/x-www-form-urlencoded content type #859

Closed
L3o-pold opened this issue Mar 19, 2024 · 1 comment · Fixed by #860

Comments

@L3o-pold
Copy link
Contributor

L3o-pold commented Mar 19, 2024

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 a Content-Type: application/x-www-form-urlencoded header result in a 500 error.

It occurs with PUT or DELETE method (not POST).

Steps To Reproduce

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
@driesvints
Copy link
Member

Thanks @L3o-pold. Seems @sy-records has already sent in a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants