summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php5.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2005-05-19 15:57:45 +0000
committerRasmus Lerdorf <rasmus@php.net>2005-05-19 15:57:45 +0000
commit091bff3570ae7b095e4719212932d6d324ecb09b (patch)
treef5220140115872d13ac6d5285549825ec017ea2d /sapi/apache/mod_php5.c
parentb45fb630d9b2cd8d2f0a42e43ad00d220a8f9999 (diff)
downloadphp-git-091bff3570ae7b095e4719212932d6d324ecb09b.tar.gz
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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 6fc4016c19..98c3d73b29 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -209,12 +209,18 @@ 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;
}
/* }}} */