改名
This commit is contained in:
@@ -98,13 +98,12 @@ class Response extends Application
|
|||||||
/**
|
/**
|
||||||
* @param $key
|
* @param $key
|
||||||
* @param $value
|
* @param $value
|
||||||
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function addHeader($key, $value)
|
public function addHeader($key, $value)
|
||||||
{
|
{
|
||||||
if ($this->isClient()) {
|
$this->headers[$key] = $value;
|
||||||
return;
|
return $this;
|
||||||
}
|
|
||||||
$this->response->header($key, $value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -184,6 +183,12 @@ class Response extends Application
|
|||||||
$this->response->status($status);
|
$this->response->status($status);
|
||||||
$this->response->header('Content-Type', $this->getContentType());
|
$this->response->header('Content-Type', $this->getContentType());
|
||||||
$this->response->header('Run-Time', $this->getRuntime());
|
$this->response->header('Run-Time', $this->getRuntime());
|
||||||
|
if (!empty($this->headers)) {
|
||||||
|
foreach ($this->headers as $key => $header) {
|
||||||
|
$this->response->header($key, $header);
|
||||||
|
}
|
||||||
|
$this->headers = [];
|
||||||
|
}
|
||||||
if (empty($sendData)) {
|
if (empty($sendData)) {
|
||||||
$sendData = '';
|
$sendData = '';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user