diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index d09b9ad778785..0c64746f8aa9e 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: