You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Edward Z. Yang" <ez...@MIT.EDU> on 2009/03/24 03:02:29 UTC

[PATCH] Send no response on 304/204

Hello all,

A patch was attached to Bug 40953, and it would be nice if some
developers could take a look at it and give some feedback and/or commit
it to the tree.

I've reposted the patch here for your convenience:

--- server/util_script.c        (revision 745696)
+++ server/util_script.c        (working copy)
@@ -488,6 +488,11 @@
              if ((cgi_status == HTTP_UNSET) && (r->method_number == M_GET)) {
                  cond_status = ap_meets_conditions(r);
              }
+            else if ((cgi_status == HTTP_NO_CONTENT) ||
+                     (cgi_status == HTTP_NOT_MODIFIED) ||
+                     ap_is_HTTP_INFO(cgi_status)) {
+                r->header_only = 1; /* discard any body */
+            }
              apr_table_overlap(r->err_headers_out, merge,
                  APR_OVERLAP_TABLES_MERGE);
              if (!apr_is_empty_table(cookie_table)) {

Cheers,
Edward