Commit 1a089351 authored by Dries's avatar Dries

- Patch #280240 by andypost: maybe some day, someone wants to post 0. :)

parent 5077fce3
...@@ -536,8 +536,9 @@ function drupal_http_request($url, array $options = array()) { ...@@ -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 // 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 // at least HEAD/GET requests, and Squid always requires Content-Length in
// POST/PUT requests. // POST/PUT requests.
if (!empty($options['data']) || $options['method'] == 'POST' || $options['method'] == 'PUT') { $content_length = strlen($options['data']);
$options['headers']['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. // If the server URL has a user then attempt to use basic authentication.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment