From: steven at pearavenue dot com Operating system: Linux PHP version: 4.3.4 PHP Bug Type: HTTP related Bug description: headers not passed in stream context
Description: ------------ Context passed to fopen does not appear to include header in request. Reproduce code: --------------- $uri = 'http://www.what-it-all-means.com/index.rdf'; $agent = "First-Say-RSS-AGGREGATOR/0.0.2.4 http://www.firstsay.net"; $since = 'Thu, 27 Nov 2003 06:03:08 GMT'; $etag = '"7051a-36a7-3fc5939c"'; $opts = array( 'http' => array( 'method' => "GET", 'header' => "If-None-Match: $etag\r\n". "If-Modified-Since: $since\r\n", 'user_agent' => $agent ) ); $context = stream_context_create($opts); $fp = @fopen($uri, 'rb', false, $context); if (!is_resource($fp)) { echo "error"; } var_dump(stream_context_get_options($fp) ); echo "\n:::::\n"; var_dump ( stream_get_meta_data($fp) ); fclose($fp); Expected result: ---------------- With the appropriate URL, http-date and etag (you may have to change those above) this should produce a 304 error Actual result: -------------- produces a 200, as though the header is ignored. -- Edit bug report at http://bugs.php.net/?id=26440&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26440&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26440&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26440&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26440&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26440&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26440&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26440&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26440&r=support Expected behavior: http://bugs.php.net/fix.php?id=26440&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26440&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26440&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26440&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26440&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26440&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26440&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26440&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26440&r=float