Open
Description
I want to check the maximum request size so that when a user upload a file larger that package_max_length
I can reject the request. But swoole does not allow me to check for this error, instead it shows warning [2025-05-07 14:16:32 *15066.2] WARNING Port_onRead_http() (ERRNO 7102): Request Entity Too Large: header-length (290) + content-length (1575386) is greater than the package_max_length(1048576) from session#1 on 0.0.0.0:8008
How Do I handle this kind of error programmatically so that I can send 413 status code to a client?.
I suggest you create
$server->on('error', function(Request $req, Response $res){
//handle payload errors and other errors gracefully
});
Thanks in advance
Metadata
Metadata
Assignees
Labels
No labels