The contract type is `' with a response time of 3 business hours.
        A first analysis should be sent before: Wed Feb 05 16:00:01 PST 1997


>Number:         155
>Category:       mod_negotiation
>Synopsis:       Bad handling of lang_index == -1 in is_variant_better().
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Feb  5 13:20:01 1997
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        1.2b2, b3, b4, b6
>Environment:
FreeBSD-2.2BETA
>Description:
Problem reported for 1.2b2, still unresolved.

lang_index is initialized to -1, but this value means better quality
then any variant and this is wrong (see test at line 1487 in mod_negotiation.c)!
This situation occurs under this condition:

client header:
Accept-Language:  en, *

httpd.conf:
LanguagePriority  en de

documents:
foo.html.en, and foo.html.de

If exists any document in the language that is not specified in accept headers,
then it has GREATER priority then any other in accept header.
In the example above, foo.html.de is selected.


>How-To-Repeat:
any URL with language content negotiation and wild card
Accept-Language: en, *
>Fix:
*** mod_negotiation.c.old       Mon Jan  6 17:21:50 1997
--- mod_negotiation.c   Mon Jan  6 17:24:57 1997
***************
*** 1482,1490 ****

      /* if language qualities were equal, try the LanguagePriority
       * stuff */
!     if (variant->lang_index > best->lang_index)
          return 0;
!     if (variant->lang_index < best->lang_index) {
          *p_bestq = q;
          return 1;
      }
--- 1482,1491 ----

      /* if language qualities were equal, try the LanguagePriority
       * stuff */
!     if (best->lang_index != -1 && variant->lang_index > best->lang_index)
          return 0;
!     if (varieant->lang_index != -1 &&
!         (variant->lang_index < best->lang_index | best->lang_index == -1)) {
          *p_bestq = q;
          return 1;
      %7
>Audit-Trail:
>Unformatted:


Reply via email to