41a6c3
--- a/modules/proxy/mod_proxy_fcgi.c	2015/01/09 21:25:26	1650676
41a6c3
+++ b/modules/proxy/mod_proxy_fcgi.c	2015/01/09 21:33:12	1650677
41a6c3
@@ -367,7 +367,7 @@
41a6c3
                              request_rec *r, int request_id)
41a6c3
 {
41a6c3
     apr_bucket_brigade *ib, *ob;
41a6c3
-    int seen_end_of_headers = 0, done = 0;
41a6c3
+    int seen_end_of_headers = 0, done = 0, ignore_body = 0;
41a6c3
     apr_status_t rv = APR_SUCCESS;
41a6c3
     int script_error_status = HTTP_OK;
41a6c3
     conn_rec *c = r->connection;
41a6c3
@@ -577,9 +577,16 @@
41a6c3
                                 APR_BRIGADE_INSERT_TAIL(ob, tmp_b);
41a6c3
                                 r->status = status;
41a6c3
                                 ap_pass_brigade(r->output_filters, ob);
41a6c3
-                                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
41a6c3
-                                              "Error parsing script headers");
41a6c3
-                                rv = APR_EINVAL;
41a6c3
+                                if (status == HTTP_NOT_MODIFIED) {
41a6c3
+                                    /* The 304 response MUST NOT contain
41a6c3
+                                     * a message-body, ignore it. */
41a6c3
+                                    ignore_body = 1;
41a6c3
+                                }
41a6c3
+                                else {
41a6c3
+                                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
41a6c3
+                                                    "Error parsing script headers");
41a6c3
+                                    rv = APR_EINVAL;
41a6c3
+                                }
41a6c3
                                 break;
41a6c3
                             }
41a6c3
 
41a6c3
@@ -598,7 +605,7 @@
41a6c3
                                 r->status = HTTP_OK;
41a6c3
                             }
41a6c3
 
41a6c3
-                            if (script_error_status == HTTP_OK) {
41a6c3
+                            if (script_error_status == HTTP_OK && !ignore_body) {
41a6c3
                                 rv = ap_pass_brigade(r->output_filters, ob);
41a6c3
                                 if (rv != APR_SUCCESS) {
41a6c3
                                     break;
41a6c3
@@ -626,7 +633,7 @@
41a6c3
                          * but that could be a huge amount of data; so we pass
41a6c3
                          * along smaller chunks
41a6c3
                          */
41a6c3
-                        if (script_error_status == HTTP_OK) {
41a6c3
+                        if (script_error_status == HTTP_OK && !ignore_body) {
41a6c3
                             rv = ap_pass_brigade(r->output_filters, ob);
41a6c3
                             if (rv != APR_SUCCESS) {
41a6c3
                                 break;