#19109 [NEW]: $http_response_header from fopen() is incomplete

From: Date: Mon, 26 Aug 2002 15:56:19 +0000
Subject: #19109 [NEW]: $http_response_header from fopen() is incomplete
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17867@lists.php.net to get a copy of this message
From: jagrant@gsc.nrcan.gc.ca Operating system: SunOS nrn1 5.8 Generic_108528-12 PHP version: 4.2.2 PHP Bug Type: HTTP related Bug description: $http_response_header from fopen() is incomplete fopen() documentation states that $http_response_header will contain the header entities. It seems to work for most URLs, but is incomplete for others. Test URL: http://atlas.gc.ca/site/english/index.html 1. test code: $f=@fopen("http://atlas.gc.ca/site/english/index.html','r'); if($f){ print_r($http_response_header); fclose($f); } gives this output: Array ( [0] => HTTP/1.0 200 OK [1] => Date: Mon, 26 Aug 2002 15:47:17 GMT [2] => Server: Apache/1.3.26 (Unix) mod_fastcgi/2.2.12 [3] => X-Powered-By: Zope (www.zope.org), Python (www.python.org) [4] => Content-Length: 24612 [5] => Content-Type: text/html [6] => X-Cache: MISS from atlas.gc.ca [7] => Connection: close ) 2. but lynx -dump -head http://atlas.gc.ca/site/english/index.html returns a more detailed response: HTTP/1.0 200 OK Date: Mon, 26 Aug 2002 15:25:10 GMT Server: Apache/1.3.26 (Unix) mod_fastcgi/2.2.12 X-Powered-By: Zope (www.zope.org), Python (www.python.org) *Content-Length: 11331 *Ms-Author-Via: DAV *Accept-Ranges: none *ETag: ts20690091.09 *Last-Modified: Fri, 23 Aug 2002 15:49:32 GMT Content-Type: text/html X-Cache: MISS from atlas.gc.ca Connection: close Items marked with * above are either missing or are different than $http_response_header. A clue may be that the "Content-Length" is different, but I don't know why. In particular, I'm looking for "Last-modified". I can get it with lynx, but not with php. John A. Grant -- Edit bug report at http://bugs.php.net/?id=19109&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19109&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19109&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19109&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19109&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19109&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19109&r=support Expected behavior: http://bugs.php.net/fix.php?id=19109&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19109&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19109&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19109&r=globals

« previous php.bugs (#17867) next »