Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 15535 invoked from network); 14 Apr 2009 13:42:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Apr 2009 13:42:36 -0000 Received: (qmail 74295 invoked by uid 500); 14 Apr 2009 13:42:35 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 74244 invoked by uid 500); 14 Apr 2009 13:42:35 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 74234 invoked by uid 99); 14 Apr 2009 13:42:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 13:42:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 13:42:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D82E0234C003 for ; Tue, 14 Apr 2009 06:42:14 -0700 (PDT) Message-ID: <1887694530.1239716534869.JavaMail.jira@brutus> Date: Tue, 14 Apr 2009 06:42:14 -0700 (PDT) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Subject: [jira] Commented: (CXF-1795) REST header case sensitivity in CXF-2.1.2 / Tomcat AJP In-Reply-To: <1386277838.1221215864255.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-1795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698774#action_12698774 ] Sergey Beryozkin commented on CXF-1795: --------------------------------------- It must have been fixed for 2.1.5-SNAPSHOT, sorry it took me so long to get it fixed. Please try the latest snapshot, available at http://repository.apache.org/snapshots/org/apache/cxf/apache-cxf/2.1.5-SNAPSHOT/ and confirm it's been fixed. The retrieval of http headers should now be case-insensitive, both for @HttpHeader and @Context HttpHeaders > REST header case sensitivity in CXF-2.1.2 / Tomcat AJP > ------------------------------------------------------ > > Key: CXF-1795 > URL: https://issues.apache.org/jira/browse/CXF-1795 > Project: CXF > Issue Type: Bug > Affects Versions: 2.1.2 > Environment: Apache-2.2, Tomcat-6.0.18, mod_jk-1.2.26 > Reporter: John Georgiadis > > HeaderParam labels in CXF-2.1.2 REST seem to be case sensitive. The problem appears only when using Tomcat-6.0.18 through its AJP connector. It does not appear when Tomcat is accessed through its HTTP connector. mod_jk (1.2.26) is passing headers unmodified to AJP, so differences in AJP & HTTP connectors make this issue manifest. > The following patch fixed the bug for us. The Tomcat HTTP connector also works with the patch. > I'm not sure whether other code paths are affected by the change in AbstractHTTPDestination, however the line after the modified code: > String mappedName = HttpHeaderHelper.getHeaderKey(fname); > already maps common upper-case headers to lower-case (except Authentication). > --- rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java 2008-08-12 23:31:10.000000000 +0300 > +++ rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java 2008-09-11 21:31:56.000000000 +0300 > @@ -190,7 +190,7 @@ > HttpServletRequest req = (HttpServletRequest)message.get(HTTP_REQUEST); > //TODO how to deal with the fields for (Enumeration e = req.getHeaderNames(); e.hasMoreElements();) { > - String fname = (String)e.nextElement(); > + String fname = ((String)e.nextElement()).toLowerCase(); > String mappedName = HttpHeaderHelper.getHeaderKey(fname); > List values; > if (headers.containsKey(mappedName)) { > --- rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java 2008-08-12 23:30:37.000000000 +0300 > +++ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java 2008-09-11 21:29:53.000000000 +0300 > @@ -449,7 +449,7 @@ > private static Object processHeaderParam(Message m, String header, Class pClass, Type genericType, String defaultValue) { > Map> headers = (Map>)m.get(Message.PROTOCOL_HEADERS); > - List values = headers.get(header); > + List values = headers.get(header.toLowerCase()); > StringBuilder sb = new StringBuilder(); > if (values != null) { > for (Iterator it = values.iterator(); it.hasNext();) { -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.