MediaWiki master
|
Inherits MediaWiki\Rest\BasicAccess\BasicAuthorizerInterface.
Public Member Functions | |
__construct (ServiceOptions $options, ResponseFactory $responseFactory, UserIdentity $user) | |
authorize (RequestInterface $request, Handler $handler) | |
Only allow registered users to make unsafe cross-origin requests. | |
createPreflightResponse (array $allowedMethods) | |
Create a CORS preflight response. | |
modifyResponse (RequestInterface $request, ResponseInterface $response) | |
Modify response to allow for CORS. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Definition at line 14 of file CorsUtils.php.
MediaWiki\Rest\CorsUtils::__construct | ( | ServiceOptions | $options, |
ResponseFactory | $responseFactory, | ||
UserIdentity | $user ) |
Definition at line 29 of file CorsUtils.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\Rest\CorsUtils::authorize | ( | RequestInterface | $request, |
Handler | $handler ) |
Only allow registered users to make unsafe cross-origin requests.
RequestInterface | $request | |
Handler | $handler |
Implements MediaWiki\Rest\BasicAccess\BasicAuthorizerInterface.
Definition at line 48 of file CorsUtils.php.
References MediaWiki\Rest\RequestInterface\getHeader(), MediaWiki\Rest\RequestInterface\hasHeader(), and MediaWiki\Rest\Handler\needsWriteAccess().
MediaWiki\Rest\CorsUtils::createPreflightResponse | ( | array | $allowedMethods | ) |
Create a CORS preflight response.
array | $allowedMethods |
Definition at line 156 of file CorsUtils.php.
MediaWiki\Rest\CorsUtils::modifyResponse | ( | RequestInterface | $request, |
ResponseInterface | $response ) |
Modify response to allow for CORS.
This method should be executed for every response from the REST API including errors.
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 101 of file CorsUtils.php.
const MediaWiki\Rest\CorsUtils::CONSTRUCTOR_OPTIONS |
Definition at line 16 of file CorsUtils.php.