Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65C511187F for ; Fri, 19 Sep 2014 13:17:34 +0000 (UTC) Received: (qmail 10185 invoked by uid 500); 19 Sep 2014 13:17:34 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 10139 invoked by uid 500); 19 Sep 2014 13:17:34 -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 10127 invoked by uid 99); 19 Sep 2014 13:17:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Sep 2014 13:17:34 +0000 Date: Fri, 19 Sep 2014 13:17:34 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6015) Path parameters containing semicolon are truncated due to missing encoding MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14140449#comment-14140449 ] Sergey Beryozkin commented on CXF-6015: --------------------------------------- It is not Tomcat or Jetty that strips ";digger" but the JAX-RS server runtime, because 'digger' becomes a matrix parameter without a value. As I said, UriBuilder.path is expected to accept path values with matrix parameters, so it can not be encoded by default. May be a property can be introduced, "url.encode.client.parameters"...Actually, there's a better way, register custom JAX-RS 2.0 ParamConverter for String and do the URL encoding there, that should work, give it a try please > Path parameters containing semicolon are truncated due to missing encoding > -------------------------------------------------------------------------- > > Key: CXF-6015 > URL: https://issues.apache.org/jira/browse/CXF-6015 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.7.12, 3.0.1 > Environment: Apache Tomcat / 7.0.54 > Eclipse Jetty / 9.2.2 > Reporter: Daniel > Attachments: cxf-test.zip > > > If a REST service uses path parameters, these parameters must not contain any semicolon as the parameter value gets truncated after the semicolon by many runtime environments. For that reason especially the semicolon should be encoded while building the client proxy. > I pinned this issue down to the usage of {{org.apache.cxf.jaxrs.utils.HttpUtils.pathEncode(String)}} during the creation of the request URI. Path parameters are encoded using a fixed list of characters ({{=@/:!$&\'(),;~}}) that are preserved in {{pathEncode(String)}}. While this is fine/needed for encoding a complete path it leads to problems if used for encoding single elements of a path like path parameters. > Attached you'll find a minimal example project containing a simple REST service that returns the provided path parameters. If deployed on localhost:8080, a call to {{http://localhost:8080/cxf-test-service-0.1/cxf-test/Rüdiger/Rü%3Bdiger}} will result in {{anAttribute=Rü, anotherAttribute=Rüdiger}} to be returned. -- This message was sent by Atlassian JIRA (v6.3.4#6332)