php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62739 getResponseCode and getResponseInfo disagree on code
Submitted: 2012-08-03 12:55 UTC Modified: 2013-10-03 01:55 UTC
From: hgs at cs dot columbia dot edu Assigned:
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.3.15 OS: Centos 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
20 + 5 = ?
Subscribe to this entry?

 
 [2012-08-03 12:55 UTC] hgs at cs dot columbia dot edu
Description:
------------
For the web site http://istt2012.comvt.org (which has one redirection), 
getResponseCode returns 302, while getResponseInfo() returns a response_code field 
of 200. In both cases, the documentation indicates that the final (last) response 
code, presumably 200, should be returned.

Test script:
---------------
$url = "http://istt2012.comvt.org";
   $r = new HttpRequest($url, HttpRequest::METH_GET);
    $r->setOptions(array(
       'redirect' => 10,
       'timeout' => 10,
       'dns_cache_timeout' => 5));
    try {
      $r->send();
      $rc = $r->getResponseCode();
      $ri = $r->getResponseInfo();
    }

Expected result:
----------------
$rc = 200;
$ri['response_code'] = 200


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-02 09:16 UTC] mike@php.net
-Status: Open +Status: Feedback -Package: HTTP related +Package: pecl_http
 [2013-10-02 09:16 UTC] mike@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2013-10-03 01:55 UTC] hgs at cs dot columbia dot edu
-Status: Feedback +Status: Closed
 [2013-10-03 01:55 UTC] hgs at cs dot columbia dot edu
The problem appears to have been fixed in pecl_http 1.7.6. (The original domain no longer exists, so this is based on another 302 domain.)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 16:01:31 2024 UTC