MediaWiki master
|
A class to assist with the parsing of Origin header according to the RFC 6454 https://tools.ietf.org/html/rfc6454#section-7. More...
Inherits MediaWiki\Rest\HeaderParser\HeaderParserBase.
Public Member Functions | |
getOriginList () | |
Get the list of origins. | |
getSingleOrigin () | |
isMultiOrigin () | |
Whether the Origin header contains multiple origins. | |
isNullOrigin () | |
Whether the Origin header was explicitly set to null . | |
match (array $allowList, array $excludeList) | |
Check whether all the origins match at least one of the rules in $allowList. | |
Static Public Member Functions | |
static | parseHeaderList (array $headerList) |
Parse an Origin header list as returned by RequestInterface::getHeader(). | |
Public Attributes | |
const | HEADER_NAME = 'Origin' |
Additional Inherited Members | |
Protected Member Functions inherited from MediaWiki\Rest\HeaderParser\HeaderParserBase | |
assertEnd () | |
If the position is not at the end of the input string, raise an error, complaining of trailing characters. | |
consumeFixedDigits ( $numDigits) | |
Consume a specified number of digits, or throw an exception. | |
consumeString ( $s) | |
Consume a specified string, or throw an exception. | |
error ( $message) | |
Throw an exception to indicate a parse error. | |
setInput ( $input) | |
Set the input, and derived convenience properties. | |
skipWhitespace () | |
Skip whitespace at the input position (OWS) | |
Protected Attributes inherited from MediaWiki\Rest\HeaderParser\HeaderParserBase | |
string | $input |
The input string being processed. | |
int | $inputLength |
The length of $input. | |
int | $pos |
The position within $input. | |
A class to assist with the parsing of Origin header according to the RFC 6454 https://tools.ietf.org/html/rfc6454#section-7.
Definition at line 12 of file Origin.php.
MediaWiki\Rest\HeaderParser\Origin::getOriginList | ( | ) |
MediaWiki\Rest\HeaderParser\Origin::getSingleOrigin | ( | ) |
Definition at line 64 of file Origin.php.
MediaWiki\Rest\HeaderParser\Origin::isMultiOrigin | ( | ) |
Whether the Origin header contains multiple origins.
Definition at line 48 of file Origin.php.
MediaWiki\Rest\HeaderParser\Origin::isNullOrigin | ( | ) |
Whether the Origin header was explicitly set to null
.
Definition at line 39 of file Origin.php.
MediaWiki\Rest\HeaderParser\Origin::match | ( | array | $allowList, |
array | $excludeList ) |
Check whether all the origins match at least one of the rules in $allowList.
string[] | $allowList | |
string[] | $excludeList |
Definition at line 77 of file Origin.php.
|
static |
Parse an Origin header list as returned by RequestInterface::getHeader().
string[] | $headerList |
Definition at line 28 of file Origin.php.
Referenced by MediaWiki\Api\ApiMain\handleCORS().
const MediaWiki\Rest\HeaderParser\Origin::HEADER_NAME = 'Origin' |
Definition at line 14 of file Origin.php.