summaryrefslogtreecommitdiff
path: root/ext/standard/http_fopen_wrapper.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-01-20 01:40:32 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-01-20 01:40:32 +0000
commit0621bcc9e1e66aaf8764c7a5f7e05687f3dd515d (patch)
tree43c1fd497af1e4e3eea54298c1a42ebc8094fe95 /ext/standard/http_fopen_wrapper.c
parentc447acf8632dd22d53e5498372f718e6e241c27a (diff)
downloadphp-git-0621bcc9e1e66aaf8764c7a5f7e05687f3dd515d.tar.gz
Allow get_headers() to return header information even for non-200 responses.
Diffstat (limited to 'ext/standard/http_fopen_wrapper.c')
-rw-r--r--ext/standard/http_fopen_wrapper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index d09b9ad778..0c64746f8a 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: