headers not passed in stream context
| Bug #26440 | headers not passed in stream context | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2003-11-27 17:03 UTC | Modified: | 2003-11-28 16:49 UTC |
|
||||||
| From: | steven at pearavenue dot com | Assigned: | pollita (profile) | |||||||
| Status: | Closed | Package: | HTTP related | |||||||
| PHP Version: | 4.3.4 | OS: | Linux | |||||||
| Private report: | No | CVE-ID: | None | |||||||
[2003-11-27 17:03 UTC] steven at pearavenue dot com
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.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-11-27 17:10 UTC] steven at pearavenue dot com
[2003-11-27 18:11 UTC] sniper@php.net
[2003-11-27 18:59 UTC] iliaa@php.net
[2003-11-28 12:52 UTC] steven at pearavenue dot com
[2003-11-28 13:05 UTC] iliaa@php.net
[2003-11-28 13:06 UTC] steven at pearavenue dot com
[2003-11-28 13:08 UTC] steven at pearavenue dot com
[2003-11-28 13:13 UTC] steven at pearavenue dot com
[2003-11-28 13:15 UTC] steven at pearavenue dot com
[2003-11-28 13:17 UTC] steven at pearavenue dot com
[2003-11-28 13:49 UTC] iliaa@php.net
[2003-11-28 13:57 UTC] steven at pearavenue dot com
[2003-11-28 14:04 UTC] steven at pearavenue dot com
[2003-11-28 14:47 UTC] steven at pearavenue dot com
[2003-11-28 16:49 UTC] steven at pearavenue dot com