This commit is contained in:
2021-03-05 13:58:40 +08:00
parent 383f83e95a
commit b61c209195
+7 -1
View File
@@ -163,6 +163,9 @@ class Response extends HttpService
if ($this->response instanceof SResponse) {
return $this->sendData($sendData, $statusCode);
} else {
if (!empty(request()->fd)) {
return '';
}
return $this->printResult($sendData);
}
}
@@ -275,8 +278,9 @@ class Response extends HttpService
* @param int $offset
* @param int $limit
* @param int $sleep
* @return string
*/
public function sendFile(string $path, $offset = 0, $limit = 1024000, $sleep = 0)
public function sendFile(string $path, $offset = 0, $limit = 1024000, $sleep = 0): string
{
$open = fopen($path, 'r');
@@ -302,6 +306,8 @@ class Response extends HttpService
$this->response->end();
$this->response = null;
return '';
}