*\r
* LICENSE:\r
*\r
- * Copyright (c) 2008, 2009, Alexey Borzov <avb@php.net>\r
+ * Copyright (c) 2008-2011, Alexey Borzov <avb@php.net>\r
* All rights reserved.\r
*\r
* Redistribution and use in source and binary forms, with or without\r
* @package HTTP_Request2\r
* @author Alexey Borzov <avb@php.net>\r
* @license http://opensource.org/licenses/bsd-license.php New BSD License\r
- * @version CVS: $Id: Adapter.php 274684 2009-01-26 23:07:27Z avb $\r
+ * @version SVN: $Id: Adapter.php 308322 2011-02-14 13:58:03Z avb $\r
* @link http://pear.php.net/package/HTTP_Request2\r
*/\r
\r
* Base class for HTTP_Request2 adapters\r
*\r
* HTTP_Request2 class itself only defines methods for aggregating the request\r
- * data, all actual work of sending the request to the remote server and \r
+ * data, all actual work of sending the request to the remote server and\r
* receiving its response is performed by adapters.\r
*\r
* @category HTTP\r
* @package HTTP_Request2\r
* @author Alexey Borzov <avb@php.net>\r
- * @version Release: 0.4.1\r
+ * @version Release: 2.0.0RC1\r
*/\r
abstract class HTTP_Request2_Adapter\r
{\r
/**\r
* Calculates length of the request body, adds proper headers\r
*\r
- * @param array associative array of request headers, this method will \r
- * add proper 'Content-Length' and 'Content-Type' headers \r
+ * @param array associative array of request headers, this method will\r
+ * add proper 'Content-Length' and 'Content-Type' headers\r
* to this array (or remove them if not needed)\r
*/\r
protected function calculateRequestLength(&$headers)\r
if (in_array($this->request->getMethod(), self::$bodyDisallowed) ||\r
0 == $this->contentLength\r
) {\r
- unset($headers['content-type']);\r
// No body: send a Content-Length header nonetheless (request #12900),\r
// but do that only for methods that require a body (bug #14740)\r
if (in_array($this->request->getMethod(), self::$bodyRequired)) {\r
$headers['content-length'] = 0;\r
} else {\r
unset($headers['content-length']);\r
+ // if the method doesn't require a body and doesn't have a\r
+ // body, don't send a Content-Type header. (request #16799)\r
+ unset($headers['content-type']);\r
}\r
} else {\r
if (empty($headers['content-type'])) {\r