From 1a089351e0f7b8a51399f5eded059beae0ae0b7b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 17 Jun 2009 11:08:46 +0000 Subject: - Patch #280240 by andypost: maybe some day, someone wants to post 0. :) --- includes/common.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 3ace4c637..1a1caad76 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -536,8 +536,9 @@ function drupal_http_request($url, array $options = array()) { // or PUT request. Some non-standard servers get confused by Content-Length in // at least HEAD/GET requests, and Squid always requires Content-Length in // POST/PUT requests. - if (!empty($options['data']) || $options['method'] == 'POST' || $options['method'] == 'PUT') { - $options['headers']['Content-Length'] = strlen($options['data']); + $content_length = strlen($options['data']); + if ($content_length > 0 || $options['method'] == 'POST' || $options['method'] == 'PUT') { + $options['headers']['Content-Length'] = $content_length; } // If the server URL has a user then attempt to use basic authentication. -- cgit v1.2.3