-
-
Notifications
You must be signed in to change notification settings - Fork 166
Closed
Labels
Description
👋 When streaming a large request (7MB jpg) I get the following error: OverflowException: Maximum header size of 8192 exceeded. in /opt/project/vendor/react/http/src/Io/RequestHeaderParser.php:43.
The error can be reproduced with the following snippet:
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use React\Http\HttpServer;
use React\Http\Message\Response;
use React\Http\Middleware\StreamingRequestMiddleware;
use React\Socket\SocketServer;
$server = new HttpServer(
new StreamingRequestMiddleware,
fn() => new Response
);
$server->on('error', function (Throwable $t) {
fwrite(STDERR, (string)$t);
});
$socket = new SocketServer('0.0.0.0:8080');
$server->listen($socket);I'm using react/http 1.6.0.
I'm trying to understand what goes on behind the curtain but can't quite figure it out. The listener that handles data coming from the connection should be removed in the RequestHeaderParser but since a new instance of the parser is made whenever data comes in from the connection the error is thrown.