diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2005-05-19 16:06:38 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2005-05-19 16:06:38 +0000 |
commit | feac7f8dbb95fe7d27d5a9001daca978c168bbb3 (patch) | |
tree | 59127fa69cc30a75626f7513c821ca00e508c853 /sapi/apache/mod_php5.c | |
parent | 496a8fbfbd482b307a3c43ff69087ec976697f87 (diff) | |
download | php-git-feac7f8dbb95fe7d27d5a9001daca978c168bbb3.tar.gz |
MFH Fix for bug #33057 - Don't send extraneous entity-headers on a 304 as per
RFC 2616 section 10.3.5
Diffstat (limited to 'sapi/apache/mod_php5.c')
-rw-r--r-- | sapi/apache/mod_php5.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 4aac2d2862..6eed907128 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -209,14 +209,20 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head */ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { - if(SG(server_context) == NULL) { /* server_context is not here anymore */ + request_rec *r = SG(server_context); + + if(r == NULL) { /* server_context is not here anymore */ return SAPI_HEADER_SEND_FAILED; } - ((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code; - send_http_header((request_rec *) SG(server_context)); + r->status = SG(sapi_headers).http_response_code; + if(r->status==304) { + send_error_response(r,0); + } else { + send_http_header(r); + } return SAPI_HEADER_SENT_SUCCESSFULLY; -} +} /* }}} */ /* {{{ sapi_apache_register_server_variables |