Pluto
  1. Pluto
  2. PLUTO-561

ResourceResponse.setContentType() with charset is broken.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: portlet container
    • Labels:
      None

      Description

      ResourceResponseImpl.setCharacterSetEncoding (and setContentType) has problems. If the content type contains a charset (text/xml;charset=utf-8), the setContentType calls setCharacterSetEncoding on "charset=utf-8" vs. utf-8. And setCharacterSetEncoding doesn't adjust accordingly. Also setCharacterSetEncoding using a previous (data member) value to set the responseContext vs. the new one passed in. Altogether it breaks resources that set a contenttype that includes a charset. I have attached a patch file that addresses these problems by altering setCharacterSetEncoding to deal with strings that contain the full charset=xxxx encoding. You might prefer instead to just fix setContentType to do the right thing and require/expect all clients to also do the right thing.

      1. pluto_561.patch
        1 kB
        Michael Freedman

        Activity

        Hide
        Michael Freedman added a comment -

        Patch for working around/fixing this problem.

        Show
        Michael Freedman added a comment - Patch for working around/fixing this problem.
        Hide
        Ate Douma added a comment -

        Thanks for finding, reporting and providing a patch Michael.
        Very timely

        I'll look into this today.

        Show
        Ate Douma added a comment - Thanks for finding, reporting and providing a patch Michael. Very timely I'll look into this today.
        Hide
        Ate Douma added a comment -

        Thanks again for the patch Mike.
        I've applied and tested it, works fine, so committed now as well.

        Show
        Ate Douma added a comment - Thanks again for the patch Mike. I've applied and tested it, works fine, so committed now as well.

          People

          • Assignee:
            Ate Douma
            Reporter:
            Michael Freedman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development