public static function parseHeaders(string $headers): array
    {
        $parsedHeaders = array();

        foreach (explode("\n", $headers) as $header) {
            @list($headerTitle, $headerValue) = explode(':', $header, 2);

            if (!isset($headerValue)) {
                continue;
            }

            $headerTitle = self::processKey(trim($headerTitle));
            $headerValue = trim($headerValue);

            if (!isset($parsedHeaders[$headerTitle])) {
                $parsedHeaders[$headerTitle] = $headerValue;
            } else {
                $parsedHeaders[$headerTitle] .= ", $headerValue";
            }
        }

        return $parsedHeaders;
    }