mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-14 00:04:32 +00:00
Ensure the curl transport supports HEAD requests. Merge from BackPress props sambauers.
git-svn-id: https://develop.svn.wordpress.org/trunk@10087 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -980,6 +980,10 @@ class WP_Http_Curl {
|
||||
$handle = curl_init();
|
||||
curl_setopt( $handle, CURLOPT_URL, $url);
|
||||
|
||||
if ( 'HEAD' === $r['method'] ) {
|
||||
curl_setopt( $handle, CURLOPT_NOBODY, true );
|
||||
}
|
||||
|
||||
if ( true === $r['blocking'] ) {
|
||||
curl_setopt( $handle, CURLOPT_HEADER, true );
|
||||
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, 1 );
|
||||
curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
|
||||
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 1 );
|
||||
curl_setopt( $handle, CURLOPT_TIMEOUT, $r['timeout'] );
|
||||
|
||||
Reference in New Issue
Block a user