http icon indicating copy to clipboard operation
http copied to clipboard

Get cookie values

Open matthijs-neijenhuijs opened this issue 10 years ago • 1 comments

I have a api where there are duplicated header keys. Is it possible to extract the headers with ignoring parseHeaders?

I changed the function:

protected function parseHeaders($response, $headerSize)
{
    $headers = substr($response, 0, $headerSize);
    $parsedHeaders = [];

    foreach (explode("\r\n",$headers) as $header)
    {
        if (strpos($header, ':'))
        {
            $nestedHeader = explode(':', $header);
            $parsedHeaders[$nestedHeader[0]][] = trim($nestedHeader[1]);
        }
    }

    return $parsedHeaders;
}

matthijs-neijenhuijs avatar May 14 '15 19:05 matthijs-neijenhuijs

Can you please elaborate on this functionality? If you still remember since it's been years 😄

Mulkave avatar Nov 02 '17 12:11 Mulkave