headers = foreach ($_SERVER as $name => $value) { if (str_starts_with($name, 'HTTP_')) { $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))); $headers[$key] = $value; } } } public function getHeaders(): array { return $this->headers; } public function getHeader(string $key): ?string { return $this->headers[$key] ?? null; } }