Skip to content

Commit b350507

Browse files
authored
Fix the serve command sometimes fails to destructure the request pool array (#55427)
The code expects the array to always contain 3 items, but apparently that's not always true. Sometimes it only contains a single key "1" with the file that was requested (when PHP serves a file). I don't know the root cause yet, but this patch seems to work around that.
1 parent d9d2b63 commit b350507

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Foundation/Console/ServeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ protected function flushOutputBuffer()
335335
} elseif ((new Stringable($line))->contains(' Closing')) {
336336
$requestPort = static::getRequestPortFromLine($line);
337337

338-
if (empty($this->requestsPool[$requestPort])) {
338+
if (empty($this->requestsPool[$requestPort]) || count($this->requestsPool[$requestPort] ?? []) !== 3) {
339339
$this->requestsPool[$requestPort] = [
340340
$this->getDateFromLine($line),
341341
false,

0 commit comments

Comments
 (0)