Skip to content

Commit 2fbc200

Browse files
[HttpKernel] Dont close the output stream in debug
1 parent 86552ea commit 2fbc200

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,6 @@ public function send()
373373
$this->sendHeaders();
374374
$this->sendContent();
375375

376-
if (function_exists('fastcgi_finish_request')) {
377-
fastcgi_finish_request();
378-
} elseif ('cli' !== PHP_SAPI) {
379-
static::closeOutputBuffers(0, true);
380-
}
381-
382376
return $this;
383377
}
384378

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ public function terminate(Request $request, Response $response)
149149
}
150150

151151
if ($this->getHttpKernel() instanceof TerminableInterface) {
152+
if (!$this->debug) {
153+
if (function_exists('fastcgi_finish_request')) {
154+
fastcgi_finish_request();
155+
} elseif ('cli' !== PHP_SAPI) {
156+
Response::closeOutputBuffers(0, true);
157+
}
158+
}
159+
152160
$this->getHttpKernel()->terminate($request, $response);
153161
}
154162
}

0 commit comments

Comments
 (0)