API / Minn\Runtime / RequestHeaders

RequestHeaders final class

Minn\Runtime\RequestHeaders · public/minn/src/Minn/Runtime/RequestHeaders.php · 82 lines

What WordPress's request functions say and send: the protocol the request came over, a status line and the no-cache headers sent as plugin code sends them, the origin a request names and whether it is allowed, and whether the browser is a phone's.

Public

staticprotocol(): string#

The protocol the request came over (wp_get_server_protocol): HTTP/1.1, 2, 2.0 or 3 as the server says, anything else HTTP/1.0.

staticstatus(mixed $code, mixed $description = ''): void#

A status line sent (status_header), through status_header; nothing for a code without a reason phrase, outside a web request, or once the head is out.

staticnoCache(): void#

The no-cache headers sent now (nocache_headers); one set to false (Last-Modified) is taken off instead.

staticorigin(): mixed#

The origin a request names (get_http_origin) as PHP sees it, else the request's own, as http_origin leaves it.

staticallowedOrigins(): mixed#

The origins allowed to call (get_allowed_http_origins): the home and site hosts over http and https, repeats dropped before allowed_http_origins adds its own.

@return list<string>
staticallowedOrigin(mixed $origin = NULL): mixed#

The origin when it is one allowed (is_allowed_http_origin), '' otherwise, as allowed_http_origin leaves it.

staticrawReferer(): mixed#

The referer as given (wp_get_raw_referer): the form's _wp_http_referer when it has one, else the Referer header, unslashed; false when neither.

staticisMobile(): mixed#

Whether the browser is a phone's or a tablet's (wp_is_mobile), as wp_is_mobile leaves it.