From: Ilia Alshanetsky Date: Fri, 20 Jan 2006 01:40:48 +0000 (+0000) Subject: MFB51: Allow get_headers() to return header information even for non-200 X-Git-Tag: RELEASE_0_9_4~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd68ac4c8c3d65d4631448d16e333ecbd2f7f652;p=php MFB51: Allow get_headers() to return header information even for non-200 responses. --- diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 6d1301af76..ade1652928 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -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: