Ensure fsockopen HTTP requests have Content-length and Content-type headers. See #4779 props DD32.
git-svn-id: https://develop.svn.wordpress.org/trunk@8588 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4ea763f026
commit
4bff225e94
@ -445,6 +445,10 @@ class WP_Http_Fsockopen {
|
||||
$strHeaders = '';
|
||||
$strHeaders .= strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
|
||||
$strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n";
|
||||
if ( ! is_null($body) ) {
|
||||
$strHeaders .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
|
||||
$strHeaders .= 'Content-Length: ' . strlen($body) . "\r\n";
|
||||
}
|
||||
|
||||
if ( is_array($headers) ) {
|
||||
foreach ( (array) $headers as $header => $headerValue )
|
||||
|
Loading…
Reference in New Issue
Block a user