[wp-trac] [WordPress Trac] #22913: Plugin Updater fails behind HTTP Proxy

WordPress Trac noreply at wordpress.org
Wed Dec 19 15:19:09 UTC 2012


#22913: Plugin Updater fails behind HTTP Proxy
-----------------------------+------------------------------
 Reporter:  samthorne        |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  3.5
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------
Changes (by samthorne):

 * keywords:  reporter-feedback =>


Comment:

 I think I've discovered the issue, the arguments within file.php include
 enabling streaming of the file.
 If streaming is enabled on your http test, then the body returns as 0:

 {{{
 if ( !empty( $_GET['test'] ) && 'http' == $_GET['test'] ) {
         $result = wp_remote_get(
 'http://downloads.wordpress.org/plugin/hotfix.1.0.zip', array( 'stream' =>
 true));
         $result['body'] = strlen( $result['body'] ) . ': ' . bin2hex(
 substr( $result['body'], 0, 10 ) );
         unset( $result['cookies'], $result['filename'] );
         echo '<pre>';
         print_r( $result );
 }
 }}}



 {{{
 Array
 (
     [headers] => Array
         (
             [server] => nginx
             [date] => Wed, 19 Dec 2012 14:49:39 GMT
             [content-type] => application/octet-stream
             [pragma] => no-cache
             [cache-control] => private
             [content-description] => File Transfer
             [content-disposition] => attachment; filename=hotfix.1.0.zip
             [x-nc] => MISS luv 139
             [connection] => close
             [content-encoding] => deflate
             [age] => 0
         )

     [body] => 0:
     [response] => Array
         (
             [code] => 200
             [message] => OK
         )

 )

 }}}

 I have curl installed on the server and judging by class-http.php, this
 would be used to download the file. So something is failing with curl and
 the proxy server while streaming the file through fopen.

 Hope this helps.

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


More information about the wp-trac mailing list