[wp-trac] Re: [WordPress Trac] #8249: Set content-length for HTTP API when the developer doesn't manually set it.

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 17 00:20:53 GMT 2008


#8249: Set content-length for HTTP API when the developer doesn't manually set it.
------------------------------+---------------------------------------------
 Reporter:  jacobsantos       |        Owner:  anonymous
     Type:  enhancement       |       Status:  new      
 Priority:  normal            |    Milestone:  2.7      
Component:  Optimization      |      Version:           
 Severity:  normal            |   Resolution:           
 Keywords:  has-patch commit  |  
------------------------------+---------------------------------------------
Comment (by DD32):

 IMO, the Developer shouldnt be setting the content length at all, That
 should be taken care of by the Class.

 Eg: http://trac.wordpress.org/browser/trunk/wp-
 includes/update.php#L214[[Br]]
 I'd personally prefer it to be written as:

 {{{
 214         $options = array(
 215             'method'        => 'POST',
 216             'timeout'        => 3,
 217             'body'            => array('themes' => serialize( $themes
 ) ),
                 'headers'        => array();
 218         );

 225         $raw_response = wp_remote_request(
 'http://api.wordpress.org/themes/update-check/1.0/', $options );
 }}}

 Oh, And wouldnt it be better to pull the lines above that patch
 http://trac.wordpress.org/browser/trunk/wp-includes/http.php#L249 (Lines
 249, 250) out of that block and set them for any requests which need it,
 rather than duplicating the line?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8249#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list