Duplicate Content-Type charset attribute causes exception
---------------------------------------------------------
Key: JBAS-4854
URL:
http://jira.jboss.com/jira/browse/JBAS-4854
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Web (Tomcat) service
Affects Versions: JBossAS-4.2.1.GA
Environment: Windows XP, JBOSS AS 4.2.1.GA
Reporter: Joni Niemi
Assigned To: Remy Maucherat
New maemo Mozilla browser has a "feature" which sends duplicate charset
parameter in the POST Content-type header. This causes following exception:
java.io.UnsupportedEncodingException: UTF-8;charset=UTF-8
at java.lang.StringCoding.decode(StringCoding.java:170)
at java.lang.String.<init>(String.java:444)
at java.lang.String.<init>(String.java:516)
at org.apache.catalina.connector.Request.setCharacterEncoding(Request.java:1469)
at
org.apache.catalina.connector.RequestFacade.setCharacterEncoding(RequestFacade.java:307)
at
com.sun.faces.context.ExternalContextImpl.setRequestCharacterEncoding(ExternalContextImpl.java:167)
at javax.faces.application.ViewHandler.initView(ViewHandler.java:259)
at org.ajax4jsf.application.ViewHandlerWrapper.initView(ViewHandlerWrapper.java:138)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:208)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at com.jamonapi.http.JAMonTomcatValve.invoke(JAMonTomcatValve.java:72)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:419)
at
org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:393)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1513)
at java.lang.Thread.run(Thread.java:619)
The erraneous* Content-Type header causing this is
"Content-Type: application/x-www-form-urlencoded; charset=UTF-8;charset=UTF-8"
("User-agent: Mozilla/5.0 (X11; U; Linux armv6l; en-GB; rv:1.9a6pre) Gecko/20070810
Firefox/3.0a1 Tablet browser 0.1.16 RX-34_2007SE_4.2007.38-2")
Windows version of Mozilla causes no problems:
"Content-Type: application/x-www-form-urlencoded; charset=UTF-8"
(User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fi; rv:1.8.1.7) Gecko/20070914
Firefox/2.0.0"
* I don't think RFC2616 strictly speakings prohibits duplicate attributes.
This seems to be Catalina issue, but I don't know which version JBOSS AS 4.2.1.GA is
using, so I'm submitting this here.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira