Destination final readonly class
Minn\Http\Destination · public/minn/src/Minn/Http/Destination.php · 102 lines
Where Minn\Http lets a request go. Only http and https; when hosts are named, every hop must start with one of them (and with one of the client's own, when it is bound); and an address outside the public internet (loopback, private and shared ranges, link-local, cloud metadata, reserved) is refused unless its host is listed in $private. A name is resolved here and curl is pinned to the addresses that were checked, so DNS cannot answer one way to the check and another to the connection.
Constants and properties
| private | readonly array $private | |
| private | readonly array $hosts | Promoted from the constructor. |
| private | readonly ?Closure $lookup | Promoted from the constructor. |
| private | readonly array $within | Promoted from the constructor. |
Public
| new | __construct(array $hosts = array ( ), array $private = array ( ), ?Closure $lookup = NULL, array $within = array ( ))# |
| ||||||||||||
| method | refusal(string $url): ?string# | Why $url may not be requested, or null when nothing about the URL itself refuses it (a name is judged again once resolved). | ||||||||||||
| method | pinned(Minn\Http\Outbound $request): Minn\Http\Outbound|Minn\Http\Exchange# | The request with curl pinned to the addresses its host resolves to, or the failed exchange when the name does not resolve or resolves somewhere private it was not allowed. | ||||||||||||
| static | host(string $url): string# | A URL's host, lower-cased, without the brackets around an IPv6 address. |
Internals 3
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
Nothing matches.