modify
This commit is contained in:
@@ -230,15 +230,15 @@ class Response extends HttpService
|
|||||||
{
|
{
|
||||||
/** @var SResponse $response */
|
/** @var SResponse $response */
|
||||||
$response = Context::getContext(SResponse::class);
|
$response = Context::getContext(SResponse::class);
|
||||||
if (!$response?->isWritable()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!isset($response->header['Content-Type'])) {
|
if (!isset($response->header['Content-Type'])) {
|
||||||
$response->header('Content-Type', 'application/json;charset=utf-8');
|
$response->header('Content-Type', 'application/json;charset=utf-8');
|
||||||
}
|
}
|
||||||
$response->header('Run-Time', $this->getRuntime());
|
$response->header('Run-Time', $this->getRuntime());
|
||||||
$response->status($this->statusCode);
|
$response->status($this->statusCode);
|
||||||
$response->end($sendData);
|
$response->end($sendData);
|
||||||
|
|
||||||
|
Context::remove(SResponse::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user