private static function getCurrentRequestHeaders() : array
    {
        $headers = [];

        if (function_exists('apache_request_headers')) {
            $requestHeaders = apache_request_headers();

            if ($requestHeaders) {
                foreach ($requestHeaders as $key => $value) {
                    $key = strtolower($key);
                    $headers[$key] = [$value];
                }

                return $headers;
            }
        }

        foreach ($_SERVER as $key => $value) {
            if (substr($key, 0, 5) === 'HTTP_') {
                $key = substr($key, 5);
            } elseif ($key !== 'CONTENT_TYPE' && $key !== 'CONTENT_LENGTH') {
                continue;
            }

            $key = strtolower(str_replace('_', '-', $key));
            $headers[$key] = [$value];
        }

        return $headers;
    }