]> granicus.if.org Git - apache/commitdiff
* mod_proxy_fcgi: Ignore body data from backend for 304 responses. PR 57198.
authorJan Kaluža <jkaluza@apache.org>
Wed, 19 Nov 2014 07:19:13 +0000 (07:19 +0000)
committerJan Kaluža <jkaluza@apache.org>
Wed, 19 Nov 2014 07:19:13 +0000 (07:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640495 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_fcgi.c

index c36d192b2429913e22cd00a9ee7c568df13497ae..aeea21c18d01e617adf484f020ca0f166fadb7f9 100644 (file)
@@ -369,7 +369,7 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf,
                              const char **err)
 {
     apr_bucket_brigade *ib, *ob;
-    int seen_end_of_headers = 0, done = 0;
+    int seen_end_of_headers = 0, done = 0, ignore_body = 0;
     apr_status_t rv = APR_SUCCESS;
     int script_error_status = HTTP_OK;
     conn_rec *c = r->connection;
@@ -579,9 +579,16 @@ recv_again:
                                 APR_BRIGADE_INSERT_TAIL(ob, tmp_b);
                                 r->status = status;
                                 ap_pass_brigade(r->output_filters, ob);
-                                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
-                                              "Error parsing script headers");
-                                rv = APR_EINVAL;
+                                if (status == HTTP_NOT_MODIFIED) {
+                                    /* The 304 response MUST NOT contain
+                                     * a message-body, ignore it. */
+                                    ignore_body = 1;
+                                }
+                                else {
+                                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
+                                                    "Error parsing script headers");
+                                    rv = APR_EINVAL;
+                                }
                                 break;
                             }
 
@@ -628,7 +635,7 @@ recv_again:
                          * but that could be a huge amount of data; so we pass
                          * along smaller chunks
                          */
-                        if (script_error_status == HTTP_OK) {
+                        if (script_error_status == HTTP_OK && !ignore_body) {
                             rv = ap_pass_brigade(r->output_filters, ob);
                             if (rv != APR_SUCCESS) {
                                 *err = "passing brigade to output filters";