Getting rid of "Vary" by altering mod_negotiation.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry for all the followups, but I wanted to post one this last
modification for comments.

Below you'll see the change I made to mod_negotiation.c that prevents
it from appending the Vary, TCN, and Content-Location headers. Since I
am only using mod_negotiation to allow me to use extension-less URLs,
I do not see a need for any of these headers.

With these changes, all of the Internet Explorer problems disappear.
It properly caches all files and does not have problem with
dynamically generated things like favicons and m3u playlists.

This modification feels "safer" than the one I previously sent.
Unconditionally wiping out the "Vary" header seems a little harsh, and
it seems like it could potentially interfere with other modules that
use "Vary", like mod_deflate and mod_proxy. (I'm just guessing about
this though.)

So... the mod_negotiation.c modifications are shown below. Is there
anything danger in doing this?


********************************************
 Change to mod_negotiation.c in 1.3.37
********************************************


--- mod_negotiation.c,orig      2007-05-04 04:18:37.000000000 +0000
+++ mod_negotiation.c   2007-05-04 04:50:17.000000000 +0000
@@ -2231,21 +2231,21 @@
                        ap_array_pstrcat(r->pool, arr, '\0'));
    }

-    if (neg->is_transparent || vary_by_type || vary_by_language ||
-        vary_by_language || vary_by_charset || vary_by_encoding) {
-
-        ap_table_mergen(hdrs, "Vary", 2 + ap_pstrcat(r->pool,
-            neg->is_transparent ? ", negotiate"       : "",
-            vary_by_type        ? ", accept"          : "",
-            vary_by_language    ? ", accept-language" : "",
-            vary_by_charset     ? ", accept-charset"  : "",
-            vary_by_encoding    ? ", accept-encoding" : "", NULL));
-    }
-
-    if (neg->is_transparent) { /* Create TCN response header */
-        ap_table_setn(hdrs, "TCN",
-                      alg_result == alg_list ? "list" : "choice");
-    }
+//    if (neg->is_transparent || vary_by_type || vary_by_language ||
+//        vary_by_language || vary_by_charset || vary_by_encoding) {
+//
+//        ap_table_mergen(hdrs, "Vary", 2 + ap_pstrcat(r->pool,
+//            neg->is_transparent ? ", negotiate"       : "",
+//            vary_by_type        ? ", accept"          : "",
+//            vary_by_language    ? ", accept-language" : "",
+//            vary_by_charset     ? ", accept-charset"  : "",
+//            vary_by_encoding    ? ", accept-encoding" : "", NULL));
+//    }
+//
+//    if (neg->is_transparent) { /* Create TCN response header */
+//        ap_table_setn(hdrs, "TCN",
+//                      alg_result == alg_list ? "list" : "choice");
+//    }
}

/**********************************************************************
@@ -2427,8 +2427,8 @@
        ap_table_unset(sub_req->err_headers_out, "Vary");
    }

-    ap_table_setn(r->err_headers_out, "Content-Location",
-                  ap_pstrdup(r->pool, variant->file_name));
+//    ap_table_setn(r->err_headers_out, "Content-Location",
+//                  ap_pstrdup(r->pool, variant->file_name));

    set_neg_headers(r, neg, alg_choice);         /* add Alternates and Vary */




********************************************
 Change to mod_negotiation.c in 2.2.4
********************************************



--- modules/mappers/mod_negotiation.c,orig      2007-05-04
04:45:00.000000000 +0000
+++ modules/mappers/mod_negotiation.c   2007-05-04 04:46:08.000000000 +0000
@@ -2605,21 +2605,21 @@
                        apr_array_pstrcat(r->pool, arr, '\0'));
    }

-    if (neg->is_transparent || vary_by_type || vary_by_language ||
-        vary_by_language || vary_by_charset || vary_by_encoding) {
-
-        apr_table_mergen(hdrs, "Vary", 2 + apr_pstrcat(r->pool,
-            neg->is_transparent ? ", negotiate"       : "",
-            vary_by_type        ? ", accept"          : "",
-            vary_by_language    ? ", accept-language" : "",
-            vary_by_charset     ? ", accept-charset"  : "",
-            vary_by_encoding    ? ", accept-encoding" : "", NULL));
-    }
-
-    if (neg->is_transparent) { /* Create TCN response header */
-        apr_table_setn(hdrs, "TCN",
-                      alg_result == alg_list ? "list" : "choice");
-    }
+//    if (neg->is_transparent || vary_by_type || vary_by_language ||
+//        vary_by_language || vary_by_charset || vary_by_encoding) {
+//
+//        apr_table_mergen(hdrs, "Vary", 2 + apr_pstrcat(r->pool,
+//            neg->is_transparent ? ", negotiate"       : "",
+//            vary_by_type        ? ", accept"          : "",
+//            vary_by_language    ? ", accept-language" : "",
+//            vary_by_charset     ? ", accept-charset"  : "",
+//            vary_by_encoding    ? ", accept-encoding" : "", NULL));
+//    }
+//
+//    if (neg->is_transparent) { /* Create TCN response header */
+//        apr_table_setn(hdrs, "TCN",
+//                      alg_result == alg_list ? "list" : "choice");
+//    }
}

/**********************************************************************
@@ -2803,8 +2803,8 @@
        apr_table_unset(sub_req->err_headers_out, "Vary");
    }

-    apr_table_setn(r->err_headers_out, "Content-Location",
-                  apr_pstrdup(r->pool, variant->file_name));
+//    apr_table_setn(r->err_headers_out, "Content-Location",
+//                  apr_pstrdup(r->pool, variant->file_name));

    set_neg_headers(r, neg, alg_choice);         /* add Alternates and Vary */

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux