#42800 [Opn->Fbk]: fopen() fails on HTTP/1.1 304 Not Modified
ID: 42800
Updated by: jani@php.net
Reported By: cellog@php.net
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: linux
PHP Version: 5.2.4
New Comment:
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.
And update version if this still is an issue..
Previous Comments:
------------------------------------------------------------------------
[2007-09-30 00:47:41] cellog@php.net
Description:
------------
When passing in an ETag or Last-Modified header to fopen() with a
remote http stream, the fopen() fails with a warning:
Warning: fopen(http://pear.php.net/rest/r/pear/allreleases.xml): failed
to open stream: HTTP request failed! HTTP/1.1 304 Not Modified
This is incorrect behavior. 304 is a valid response code which is
useful for HTTP caching.
The correct response is to allow the stream to return, and require
users to use stream_get_meta_data() to retrieve the response headers.
Now, the only way is to parse the error message, an ugly hack at best
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42800&edit=1
Thread (2 messages)