]> granicus.if.org Git - php/commitdiff
MFB51: Allow get_headers() to return header information even for non-200
authorIlia Alshanetsky <iliaa@php.net>
Fri, 20 Jan 2006 01:40:48 +0000 (01:40 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 20 Jan 2006 01:40:48 +0000 (01:40 +0000)
responses.

ext/standard/http_fopen_wrapper.c

index 6d1301af768e72484a746f2e8902ab4b57805505..ade1652928b54ea5eab3755f3113e4fccb7cf714 100644 (file)
@@ -487,6 +487,10 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
                        } else {
                                response_code = 0;
                        }
+                       /* when we request only the header, don't fail even on error codes */
+                       if (options & STREAM_ONLY_GET_HEADERS) {
+                               reqok = 1;
+                       }
                        switch(response_code) {
                                case 200:
                                case 302: