summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-06-17 11:08:46 +0000
committerDries Buytaert <dries@buytaert.net>2009-06-17 11:08:46 +0000
commit1a089351e0f7b8a51399f5eded059beae0ae0b7b (patch)
treef316a131515059baba2f19d44731c55d55e8e742
parent5077fce3d6552cef77b6d43b3143dd80568b7c2c (diff)
downloadbrdo-1a089351e0f7b8a51399f5eded059beae0ae0b7b.tar.gz
brdo-1a089351e0f7b8a51399f5eded059beae0ae0b7b.tar.bz2
- Patch #280240 by andypost: maybe some day, someone wants to post 0. :)
-rw-r--r--includes/common.inc5
1 files changed, 3 insertions, 2 deletions
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.