You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Victor S. (JIRA)" <de...@myfaces.apache.org> on 2007/11/14 16:33:43 UTC

[jira] Created: (TRINIDAD-819) DispachRenderResponse/DispatchServletResponse does not detect content type if space is present

DispachRenderResponse/DispatchServletResponse does not detect content type if space is present
----------------------------------------------------------------------------------------------

                 Key: TRINIDAD-819
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-819
             Project: MyFaces Trinidad
          Issue Type: Bug
         Environment: Java 6, windows and linux
            Reporter: Victor S.
            Priority: Minor


DispachRenderResponse/DispatchServletResponse (in package org.apache.myfaces.trinidadinternal.config.dispatch) does not detect the correct content type if a space exists before character encoding declaration (i.e. "application/xhtml+xml; charset=ISO-8859-1").

The current Pattern is:
static private final Pattern _CONTENT_TYPE_PATTERN =
                                  Pattern.compile("([^;]+)(?:;charset=(.*))?");

I think it must be:
static private final Pattern _CONTENT_TYPE_PATTERN =
                                  Pattern.compile("([^;]+)(?:;\\s*?charset=(.*))?");

A workaround exists: removing white spaces between media type" and parameters (i.e. in "<%@page contentType" directive).

Is not there (both classes) common code which is possible to extract?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.