mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 15:31:42 +01:00
Ensure the curl transport supports HEAD requests. Merge from BackPress props sambauers.
git-svn-id: http://svn.automattic.com/wordpress/trunk@10087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
55968bde15
commit
d9778f61f3
@ -980,6 +980,10 @@ class WP_Http_Curl {
|
|||||||
$handle = curl_init();
|
$handle = curl_init();
|
||||||
curl_setopt( $handle, CURLOPT_URL, $url);
|
curl_setopt( $handle, CURLOPT_URL, $url);
|
||||||
|
|
||||||
|
if ( 'HEAD' === $r['method'] ) {
|
||||||
|
curl_setopt( $handle, CURLOPT_NOBODY, true );
|
||||||
|
}
|
||||||
|
|
||||||
if ( true === $r['blocking'] ) {
|
if ( true === $r['blocking'] ) {
|
||||||
curl_setopt( $handle, CURLOPT_HEADER, true );
|
curl_setopt( $handle, CURLOPT_HEADER, true );
|
||||||
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 1 );
|
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 1 );
|
||||||
@ -989,7 +993,6 @@ class WP_Http_Curl {
|
|||||||
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 0 );
|
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 1 );
|
|
||||||
curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
|
curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
|
||||||
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 1 );
|
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 1 );
|
||||||
curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] );
|
curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] );
|
||||||
|
Loading…
Reference in New Issue
Block a user