You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Koen Holtman <Ko...@cern.ch> on 1999/01/20 19:46:03 UTC

Re: lynx-dev Apache 1.3.4 <-> Lynx 2.[78] compatibility problem


On Tue, 19 Jan 1999, Klaus Weide wrote:

[...]
> I don't know what those unspecified servers are/where, and agree that
> Lynx shouldn't send that header.
[...]
> So this should change immediately in the current Lynx development code.

OK.

> As for the compatibility fix for Apache suggested (below): if that is
> done, it should be done in a way that doesn't prevent negotiation from
> working right if/when some future Lynx version supports transparent
> negotiation (and really means the header it sends).  So it should match on
> something like "Lynx.2.[78]" or "Lynx.(7|8([^.]|\.[12]))", the latter
> allows for the possibility that that hypothetical version might be
> Lynx/2.8.n with n > 2.  It would be desirable to make the regex as liberal
> as possible (no "^", using "." instead of "/" and "\." for example, using
> NoCase match), since many Lynx users modify the User-Agent string to get
> around graphics-only bias, so that "lynx" may appear in a ( comment ) and
> may not have exactly the right punctuation.

Coping with user-modified User-Agent strings can be tricky, and cannot
really be reconciled with trying to limit the range of lynx version
numbers. 

Luckily, a possible future Lynx version which *does* implement transparent
content negotiation is not very likely to send 'negotiate: trans', it will
more likely send 'negotiate: 1.0' or 'negotiate: vlist'.  So I plan to do
the following:

  - match on plain 'Lynx'
  - but only enable the bug workaround if the Negotiate header has 'trans'
    as the exact contents.

In the unlikely case that a future transparent content negotiation
implementation in Lynx would need to get the exact effect of sending
'negotiate: trans', then it could send something like 'negotiate: trans,
trans' to bypass the bug workaround.  (Saying 'trans' twice is
semantically equivalent to saying it only once.)

>     Klaus

Koen.



[PATCH] Apache 1.3.4 <-> Lynx 2.[78] compatibility problem

Posted by Koen Holtman <Ko...@cern.ch>.
Here is an Apache 1.3.4 patch for the 'short term fix' of the apache <->
lynx problem which I described earlier.

Koen.

diff -u ../apache134orig/conf/httpd.conf-dist conf/httpd.conf-dist
--- ../apache134orig/conf/httpd.conf-dist	Wed Jan 20 23:10:51 1999
+++ conf/httpd.conf-dist	Thu Jan 21 00:08:14 1999
@@ -743,6 +743,14 @@
 BrowserMatch "JDK/1\.0" force-response-1.0
 
 #
+# The following directive makes mod_negotiation ignore the 'negotiate:
+# trans' header which is erroneously sent by Lynx versions 2.7 and 2.8.
+# Lynx allows its users to reconfigure the user-agent string so we use
+# a very loose match.
+#
+BrowserMatchNoCase "lynx" ignore-negotiate-single-trans
+
+#
 # Allow server status reports, with the URL of http://servername/server-status
 # Change the ".your_domain.com" to match your domain to enable.
 #
diff -u ../apache134orig/conf/httpd.conf-dist-win conf/httpd.conf-dist-win
--- ../apache134orig/conf/httpd.conf-dist-win	Wed Jan 20 23:10:51 1999
+++ conf/httpd.conf-dist-win	Thu Jan 21 00:08:31 1999
@@ -688,6 +688,14 @@
 BrowserMatch "JDK/1\.0" force-response-1.0
 
 #
+# The following directive makes mod_negotiation ignore the 'negotiate:
+# trans' header which is erroneously sent by Lynx versions 2.7 and 2.8.
+# Lynx allows its users to reconfigure the user-agent string so we use
+# a very loose match.
+#
+BrowserMatchNoCase "lynx" ignore-negotiate-single-trans
+
+#
 # Allow server status reports, with the URL of http://servername/server-status
 # Change the ".your_domain.com" to match your domain to enable.
 #
diff -u ../apache134orig/src/modules/standard/mod_negotiation.c src/modules/standard/mod_negotiation.c
--- ../apache134orig/src/modules/standard/mod_negotiation.c	Wed Jan 20 23:10:45 1999
+++ src/modules/standard/mod_negotiation.c	Thu Jan 21 00:00:41 1999
@@ -521,6 +521,25 @@
          * a sub- or super- request on a transparent resource.
          */
 
+	/* Lynx 2.7 and 2.8 send 'negotiate: trans' even though they
+         * do not support transparent content negotiation.  We
+         * implement a directive for use with a BrowserMatchNoCase as
+         * a workaround.  The directive has the effect of ignoring the
+         * negotiate header when its contents are exactly "trans".
+         * The BrowserMatchNoCase in the distribution config file will
+         * also match future versions of Lynx which could implement
+         * transparent content negotiation.  If such future versions
+         * ever need to say 'negotiate: trans', they can send the
+         * equivalent 'negotiate: trans, trans' instead to avoid
+         * triggering the bug workaround below. 
+         */
+
+	if(strcmp(negotiate,"trans")==0 &&
+	   ap_table_get(r->subprocess_env, "ignore-negotiate-single-trans")) {
+	    *negotiate = 0;
+	    ap_table_mergen(r->err_headers_out, "Vary" , "user-agent");
+	}
+
         while (*negotiate) {
             char *tok = ap_get_token(neg->pool, &negotiate, 1);
             char *cp;