MediaWiki REL1_39
|
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. | |
Definition at line 14 of file CorsUtils.php.
MediaWiki\Rest\CorsUtils::__construct | ( | ServiceOptions | $options, |
ResponseFactory | $responseFactory, | ||
UserIdentity | $user ) |
ServiceOptions | $options | |
ResponseFactory | $responseFactory | |
UserIdentity | $user |
Definition at line 39 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 58 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 164 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 109 of file CorsUtils.php.