]> granicus.if.org Git - php/commitdiff
Fix for bug #33057 - Don't send extraneous entity-headers on a 304 as per
authorRasmus Lerdorf <rasmus@php.net>
Thu, 19 May 2005 16:14:46 +0000 (16:14 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Thu, 19 May 2005 16:14:46 +0000 (16:14 +0000)
RFC 2616 section 10.3.5

sapi/apache/mod_php4.c

index 08511770986e9d431228415abd98578ca1a7e952..da29146173540b5d3a0fca8c9de73d8ace2e0778 100644 (file)
@@ -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;
 }
 /* }}} */