This commit is contained in:
2021-08-28 00:52:20 +08:00
parent a29ed02053
commit 8be7975d54
4 changed files with 157 additions and 12 deletions
+36 -4
View File
@@ -70,10 +70,42 @@ class Response extends HttpService implements ResponseInterface
$this->clientId = $int;
$manager = Kiri::getDi()->get(ServerManager::class);
$this->_clientInfo = $manager->getServer()->getClientInfo($int);
if (!empty($this->reactorId))
{
$this->reactorId = $reID;
}
if (!empty($this->reactorId)) {
$this->reactorId = $reID;
}
return $this;
}
/**
* @param $value
* @return $this
*/
public function withAccessControlAllowHeaders($value): static
{
$this->headers['Access-Control-Allow-Headers'] = $value;
return $this;
}
/**
* @param $value
* @return $this
*/
public function withAccessControlRequestMethod($value): static
{
$this->headers['Access-Control-Request-Method'] = $value;
return $this;
}
/**
* @param $value
* @return $this
*/
public function withAccessControlAllowOrigin($value): static
{
$this->headers['Access-Control-Allow-Origin'] = $value;
return $this;
}