From f5ec38f222ea6ddb3cd615617541c7bf5e3eeb81 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 17 Nov 2008 21:21:35 +0000 Subject: [PATCH] Auto set content-length. Props jacobsantos. fixes #8249 git-svn-id: https://develop.svn.wordpress.org/trunk@9741 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/http.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/http.php b/wp-includes/http.php index e15f0797d4..cffc88e853 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -250,6 +250,9 @@ class WP_Http { $r['headers']['Content-Length'] = strlen($r['body']); } + if ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) ) + $r['headers']['Content-Length'] = strlen($r['body']); + $transports = WP_Http::_postTransport($r); }