Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.922
diff -u -p -r1.922 common.inc
--- includes/common.inc	13 Jun 2009 19:28:57 -0000	1.922
+++ includes/common.inc	17 Jun 2009 08:51:09 -0000
@@ -536,8 +536,9 @@ function drupal_http_request($url, 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.
