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

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 20 21:35:03 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):

 Maybe I missed something of the above but:

 1. you send a head request it returns "Response: HTTP/1.1 200 OK Date:
 Sun, 20 Mar 2011 20:49:41 GMT Server: Apache Cache-Control: no-cache
 Expires: Thu, 4 Jan 1990 10:00:01 GMT Last-Modified: Tue, Jan 27 2099
 23:59:59 GMT Pragma: no-cache X-ATG-Version: ATGPlatform/7.2 [
 DASLicense/0 DPSLicense/0 ] Set-Cookie:
 JSESSIONID=PNZORWDSL2JJHQE1GHPCKH4ATMY32JVN; path=/ Content-Length: 0
 Connection: close Content-Type: text/html"

 2. so you think it is ok and send a get request: it now returns an empty
 string as request but the CURLINFO_HTTP_CODE contains a 301/302 So... it
 falls into:
 {{{
 if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301,
 302) ) )
                                 echo 'http_request_failed';wp_die();
                                 return new WP_Error('http_request_failed',
 __('Too many redirects.'));
 }}}

 3. However ... when I do a direct get request with my test script I get:
 HTTP/1.1 302 Moved Temporarily Date: Sun, 20 Mar 2011 21:14:36 GMT Server:
 Apache Cache-Control: no-cache Expires: Thu, 4 Jan 1990 10:00:01 GMT Last-
 Modified: Tue, Jan 27 2099 23:59:59 GMT Pragma: no-cache X-ATG-Version:
 ATGPlatform/7.2 [ DASLicense/0 DPSLicense/0 ] Set-Cookie:
 JSESSIONID=TK21PGAJSFZPRQE1GHRSKH4ATMY32JVN; path=/ Location:
 https://login.techweb.com/cas/login?service=http%3A//www.informationweek.com/nopagefound.jhtml%3Bjsessionid%3DTK21PGAJSFZPRQE1GHRSKH4ATMY32JVN&gateway=true
 Connection: close Content-Type: text/html Vary: Accept-Encoding, User-
 Agent

 Which contains the correct forwarding URI (so will never jump in that part
 of not having no return value?

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


More information about the wp-trac mailing list