MediaWiki REL1_37
|
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. | |
Private Member Functions | |
allowOrigin (Origin $origin) | |
getCanonicalDomain () | |
Private Attributes | |
ServiceOptions | $options |
ResponseFactory | $responseFactory |
UserIdentity | $user |
Definition at line 13 of file CorsUtils.php.
MediaWiki\Rest\CorsUtils::__construct | ( | ServiceOptions | $options, |
ResponseFactory | $responseFactory, | ||
UserIdentity | $user | ||
) |
ServiceOptions | $options | |
ResponseFactory | $responseFactory | |
UserIdentity | $user |
Definition at line 38 of file CorsUtils.php.
References MediaWiki\Rest\CorsUtils\$options, MediaWiki\Rest\CorsUtils\$responseFactory, MediaWiki\Rest\CorsUtils\$user, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
|
private |
Origin | $origin |
Definition at line 79 of file CorsUtils.php.
Referenced by MediaWiki\Rest\CorsUtils\authorize().
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 57 of file CorsUtils.php.
References MediaWiki\Rest\CorsUtils\allowOrigin(), 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 162 of file CorsUtils.php.
|
private |
Definition at line 89 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 107 of file CorsUtils.php.
|
private |
Definition at line 25 of file CorsUtils.php.
Referenced by MediaWiki\Rest\CorsUtils\__construct().
|
private |
Definition at line 28 of file CorsUtils.php.
Referenced by MediaWiki\Rest\CorsUtils\__construct().
|
private |
Definition at line 31 of file CorsUtils.php.
Referenced by MediaWiki\Rest\CorsUtils\__construct().