You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/08/20 00:32:30 UTC

svn commit: r987338 - /myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java

Author: mfreedman
Date: Thu Aug 19 22:32:30 2010
New Revision: 987338

URL: http://svn.apache.org/viewvc?rev=987338&view=rev
Log:
PORTLETBRIDGE-166: Bridge header management can generate invalid ContentType (header)

Modified:
    myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java

Modified: myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java?rev=987338&r1=987337&r2=987338&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java (original)
+++ myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/util/map/PortletRequestHeaders.java Thu Aug 19 22:32:30 2010
@@ -233,10 +233,19 @@ public class PortletRequestHeaders
       ((ActionRequest) mPortletRequest).getCharacterEncoding();
 
     if (contentType != null)
-    {
-      property = property.append(contentType);
-      if (charset != null)
-      {
+     {
+       if (charset != null)
+       {
+         // remove existing charset if its there -- it might be incorrect in a wsrp world
+         int index = contentType.indexOf(";");
+         if (index < 0)
+         {
+            property = property.append(contentType);
+         }
+         else
+         {
+           property = property.append(contentType, 0, index);
+         }
         property = property.append("; charset=");
         property = property.append(charset);
       }