[wp-trac] [WordPress Trac] #16855: HTTP API No Follow Redirection

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 20 21:39:22 UTC 2011


#16855: HTTP API No Follow Redirection
--------------------------+------------------------------
 Reporter:  TheDeadMedic  |       Owner:  dd32
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTTP          |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by cogmios):

 I also notice the following but maybe Im totally wrong there is the line:
 {{{
 if ( true === $r['blocking'] )
                 {
                         curl_setopt( $handle, CURLOPT_HEADER, true );
                 }
                 else
                 {
                         curl_setopt( $handle, CURLOPT_HEADER, false );
                         echo "oh oh ";
                 }
 }}}

 (I put the oh oh there)

 If I call wp_remote-whatever with this:

 {{{
 $http_args_get = array (
                                 'method' => 'GET',
                                 'timeout' => 300,
                                 'redirection' => 0,
                                 'httpversion' => '1.0',
                                 'user-agent' => "WordPress"),
                                 'blocking' => true,
                                 'headers' => array(),
                                 'cookies' => array(),
                                 'body' => null,
                                 'compress' => false,
                                 'decompress' => true,
                                 'sslverify' => false,
                             'followlocation' => false
                         );
 $response =
 wp_remote_get('http://www.informationweek.com/story/',$http_args_get);
 }}}

 (so with blocking set to true)
 It Will ALWAYS fall in the "oh oh" loop because it gets converted to "1"
 in the array.

 But probably I do something wrong. Here is the output of the array:
 {{{
 oh oh [-- Response: --](http://www.informationweek.com/story/)
 Array ( [method] => GET [timeout] => 300 [redirection] => 0 [httpversion]
 => 1.0
 [followlocation] => [blocking] => 1 [headers] => Array ( [Accept-Encoding]
 =>
 deflate;q=1.0, compress;q=0.5 ) [body] => [cookies] => Array ( ) [user-
 agent] =>
 WordPress/WP-Favicons/http://127.0.0.1/wp2 [compress] => [decompress] => 1
 [sslverify] =>
 [ssl] => [local] => ) [-- R: 1--](http://www.informationweek.com/story/)
 WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0]
 => Maximum (0)
 redirects followed ) ) [error_data] => Array ( ) )
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16855#comment:21>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list