From 2a421f116f905b0d7f4778a936f55b27dd7a817c Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 12 Dec 2008 16:07:13 +0000 Subject: - Patch #345167 by JacobSignh, pwolanin, jlkreiss, keith.smith et al: fix some new line behavior in drupal_http_request(). --- includes/common.inc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index e9b325288..09432d55e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -531,15 +531,12 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = } foreach ($headers as $header => $value) { - $defaults[$header] = $header . ': ' . $value; + $defaults[$header] = $header . ': ' . trim($value); } $request = $method . ' ' . $path . " HTTP/1.0\r\n"; $request .= implode("\r\n", $defaults); - $request .= "\r\n\r\n"; - if ($data) { - $request .= $data . "\r\n"; - } + $request .= "\r\n\r\n" . $data; $result->request = $request; fwrite($fp, $request); -- cgit v1.2.3