This commit is contained in:
2021-08-10 17:04:27 +08:00
parent 2e0a56dd27
commit 9557989011
+3 -3
View File
@@ -22,11 +22,11 @@ class ResponseEmitter
public function sender(\Swoole\Http\Response $response, ResponseInterface $emitter) public function sender(\Swoole\Http\Response $response, ResponseInterface $emitter)
{ {
$content = $emitter->configure($response)->getContent(); $content = $emitter->configure($response)->getContent();
if (!($content instanceof FileFormatter)) { if ($content instanceof FileFormatter) {
$this->download($content->getData(), $response);
} else {
$response->end($content->getData()); $response->end($content->getData());
return;
} }
$this->download($content->getData(), $response);
} }