diff --git a/http-server/Constrict/Request.php b/http-server/Constrict/Request.php index b7589565..bf9ff7b7 100644 --- a/http-server/Constrict/Request.php +++ b/http-server/Constrict/Request.php @@ -405,4 +405,31 @@ class Request implements RequestInterface { return $this->__call__()->{__FUNCTION__}(); } + + + /** + * @return string|null + */ + public function getAccessControlAllowOrigin(): ?string + { + return $this->__call__()->{__FUNCTION__}(); + } + + + /** + * @return string|null + */ + public function getAccessControlAllowHeaders(): ?string + { + return $this->__call__()->{__FUNCTION__}(); + } + + + /** + * @return string|null + */ + public function getAccessControlRequestMethod(): ?string + { + return $this->__call__()->{__FUNCTION__}(); + } } diff --git a/http-server/Constrict/Response.php b/http-server/Constrict/Response.php index 7a2dd745..219909c9 100644 --- a/http-server/Constrict/Response.php +++ b/http-server/Constrict/Response.php @@ -5,6 +5,7 @@ namespace Server\Constrict; use Http\Context\Context; +use JetBrains\PhpStorm\Pure; use Psr\Http\Message\StreamInterface; use Server\Message\Response as Psr7Response; use Server\ResponseInterface; @@ -279,4 +280,31 @@ class Response implements ResponseInterface { return $this->__call__()->{__FUNCTION__}($value); } + + + /** + * @return string|null + */ + public function getAccessControlAllowOrigin(): ?string + { + return $this->__call__()->{__FUNCTION__}(); + } + + + /** + * @return string|null + */ + public function getAccessControlAllowHeaders(): ?string + { + return $this->__call__()->{__FUNCTION__}(); + } + + + /** + * @return string|null + */ + public function getAccessControlRequestMethod(): ?string + { + return $this->__call__()->{__FUNCTION__}(); + } } diff --git a/http-server/RequestInterface.php b/http-server/RequestInterface.php index d5de61ed..fbcf4dfe 100644 --- a/http-server/RequestInterface.php +++ b/http-server/RequestInterface.php @@ -132,4 +132,24 @@ interface RequestInterface extends \Psr\Http\Message\RequestInterface * @return int */ public function getClientId(): int; + + + + /** + * @return string|null + */ + #[Pure] public function getAccessControlAllowOrigin(): ?string; + + + + /** + * @return string|null + */ + #[Pure] public function getAccessControlAllowHeaders(): ?string; + + + /** + * @return string|null + */ + #[Pure] public function getAccessControlRequestMethod(): ?string; } diff --git a/http-server/ResponseInterface.php b/http-server/ResponseInterface.php index 56269b7b..d7589b3d 100644 --- a/http-server/ResponseInterface.php +++ b/http-server/ResponseInterface.php @@ -3,6 +3,7 @@ namespace Server; +use JetBrains\PhpStorm\Pure; use Server\Message\Response; use Server\SInterface\DownloadInterface; @@ -87,4 +88,25 @@ interface ResponseInterface extends \Psr\Http\Message\ResponseInterface */ public function withAccessControlAllowHeaders(string $value): ResponseInterface; + + + /** + * @return string|null + */ + #[Pure] public function getAccessControlAllowOrigin(): ?string; + + + + /** + * @return string|null + */ + #[Pure] public function getAccessControlAllowHeaders(): ?string; + + + /** + * @return string|null + */ + #[Pure] public function getAccessControlRequestMethod(): ?string; + + }