--- common.inc.old	2008-12-10 23:30:13.000000000 +0100
+++ common.inc	2008-12-12 08:14:11.000000000 +0100
@@ -483,10 +483,12 @@
     // We don't add the port to prevent from breaking rewrite rules checking the
     // host that do not take into account the port number.
     'Host' => "Host: $host",
-    'User-Agent' => 'User-Agent: Drupal (+http://drupal.org/)',
-    'Content-Length' => 'Content-Length: '. strlen($data)
+    'User-Agent' => 'User-Agent: Drupal (+http://drupal.org/)'
   );
 
+  if ($data != '') {
+    $defaults['Content-Length'] = 'Content-Length: '. strlen($data);
+  }
   // If the server url has a user then attempt to use basic authentication
   if (isset($uri['user'])) {
     $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : ''));
