Apache Roller
  1. Apache Roller
  2. ROL-1906

Accept-Language header parsing broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a Problem
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The following request returns a 404 message in German when it should be in English. I have tested the underlying Tomcat ServletRequest.getLocale() implementation and that does return the correct value.

      GET /foo/bar HTTP/1.1
      Host: blogs.apache.org
      Accept-Language: en,de;q=0.5

      Version is Version 5.0.0-RC1 (r990388)

        Activity

        Glen Mazza made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Not A Problem [ 8 ]
        Hide
        Glen Mazza added a comment -

        IIRC Roller updated its JSTL version in trunk, hopefully the problem has gone away with that upgrade, but per the comments it looks like the bug report (if it still exists) should be directed to those maintaining JSTL. As this occurs only on certain Roller pages and only for users that declare multiple languages to be OK, I don't see a need for Roller to patch the apparent JSTL bug (if it still exists), as the latter is still choosing a language declared to be acceptable but just not honoring the preferred one.

        Show
        Glen Mazza added a comment - IIRC Roller updated its JSTL version in trunk, hopefully the problem has gone away with that upgrade, but per the comments it looks like the bug report (if it still exists) should be directed to those maintaining JSTL. As this occurs only on certain Roller pages and only for users that declare multiple languages to be OK, I don't see a need for Roller to patch the apparent JSTL bug (if it still exists), as the latter is still choosing a language declared to be acceptable but just not honoring the preferred one.
        Mark Thomas made changes -
        Workflow jira [ 12544014 ] Default workflow, editable Closed status [ 12623603 ]
        Hide
        Mark Thomas added a comment -

        This originated with a bug report to INFRA for the ASF roller installation so I'd have to say there is at least one user that uses quality factors in their Accept-Language header.

        I agree the issue is a minor one.

        Show
        Mark Thomas added a comment - This originated with a bug report to INFRA for the ASF roller installation so I'd have to say there is at least one user that uses quality factors in their Accept-Language header. I agree the issue is a minor one.
        David Johnson made changes -
        Fix Version/s 5.0 [ 12313828 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Hide
        David Johnson added a comment -

        This is a problem with the underlying JSTL implementation used on the Roller JSP pages and I am able to reproduce the error outside of Roller with a simple JSP page. JSTL is picking the wrong locale. Roller uses the latest JSTL implementation, so the proper course of action here is to report a bug to the JSTL developers and, if possible, create a work-around for Roller.

        <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
        <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
        <fmt:setBundle basename="ApplicationResources" />
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <title><fmt:message key="error.title.404" /></title>

        Only the Roller editor/admin page is effected by this bug, not blog pages which use Servlet API directly.

        This seems like a pretty minor issue, do "real users" really put Relative Quality Factors in their Accept-Langauge header?

        Show
        David Johnson added a comment - This is a problem with the underlying JSTL implementation used on the Roller JSP pages and I am able to reproduce the error outside of Roller with a simple JSP page. JSTL is picking the wrong locale. Roller uses the latest JSTL implementation, so the proper course of action here is to report a bug to the JSTL developers and, if possible, create a work-around for Roller. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <fmt:setBundle basename="ApplicationResources" /> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><fmt:message key="error.title.404" /></title> Only the Roller editor/admin page is effected by this bug, not blog pages which use Servlet API directly. This seems like a pretty minor issue, do "real users" really put Relative Quality Factors in their Accept-Langauge header?
        David Johnson made changes -
        Field Original Value New Value
        Fix Version/s 5.0 [ 12313828 ]
        Mark Thomas created issue -

          People

          • Assignee:
            Roller Unassigned
            Reporter:
            Mark Thomas
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development