- Patch #28629 by chx: fixed handling of cookies in drupal_http_request().

4.7.x
Dries Buytaert 2005-08-22 20:24:53 +00:00
parent e0113d6788
commit 7d9f29aca7
1 changed files with 8 additions and 1 deletions

View File

@ -395,7 +395,14 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
// Parse headers.
while ($line = trim(array_shift($headers))) {
list($header, $value) = explode(':', $line, 2);
$result->headers[$header] = trim($value);
if (isset($result->headers[$header]) && $header == 'Set-Cookie') {
// RFC 2109: the Set-Cookie response header comprises the token Set-
// Cookie:, followed by a comma-separated list of one or more cookies.
$result->headers[$header] .= ','. trim($value);
}
else {
$result->headers[$header] = trim($value);
}
}
$responses = array(