SanitizeCombinedHeadersPropagationGetter
in package
implements
PropagationGetterInterface
FinalYes
Some servers concatenate multiple headers with ';' -- we need to replace these with ',' This is still a workaround and doesn't get around the problem fully, specifically it doesn't handle edge cases where the header has a trailing ';' or an empty trace state.
We also need to trim trailing separators from the header, found when a header is empty.
Table of Contents
Interfaces
Constants
- LIST_MEMBERS_SEPARATOR = ','
- SERVER_CONCAT_HEADERS_REGEX = '/;(?=[^,=;]*=|$)/'
- TRAILING_LEADING_SEPARATOR_REGEX = '/^' . self::LIST_MEMBERS_SEPARATOR . '+|' . self::LIST_MEMBERS_SEPARATOR . '+$/'
Properties
Methods
- __construct() : mixed
- get() : string|null
- Gets the value of a given key from a carrier.
- keys() : array<int, string>
- Returns the list of all the keys in the carrier.
Constants
LIST_MEMBERS_SEPARATOR
private
mixed
LIST_MEMBERS_SEPARATOR
= ','
SERVER_CONCAT_HEADERS_REGEX
private
mixed
SERVER_CONCAT_HEADERS_REGEX
= '/;(?=[^,=;]*=|$)/'
TRAILING_LEADING_SEPARATOR_REGEX
private
mixed
TRAILING_LEADING_SEPARATOR_REGEX
= '/^' . self::LIST_MEMBERS_SEPARATOR . '+|' . self::LIST_MEMBERS_SEPARATOR . '+$/'
Properties
$getter read-only
private
PropagationGetterInterface
$getter
Methods
__construct()
public
__construct(PropagationGetterInterface $getter) : mixed
Parameters
- $getter : PropagationGetterInterface
get()
Gets the value of a given key from a carrier.
public
get(mixed $carrier, string $key) : string|null
Parameters
- $carrier : mixed
- $key : string
Return values
string|nullkeys()
Returns the list of all the keys in the carrier.
public
keys(mixed $carrier) : array<int, string>
Parameters
- $carrier : mixed