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 20D90EFE3 for ; Fri, 1 Mar 2013 14:11:13 +0000 (UTC) Received: (qmail 30080 invoked by uid 500); 1 Mar 2013 14:11:13 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 30047 invoked by uid 500); 1 Mar 2013 14:11:13 -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 30037 invoked by uid 99); 1 Mar 2013 14:11:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Mar 2013 14:11:13 +0000 Date: Fri, 1 Mar 2013 14:11:12 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-4861) Encoding issue jax-rs - UriBuilder 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-4861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13590541#comment-13590541 ] Sergey Beryozkin commented on CXF-4861: --------------------------------------- Thanks Aki - so the proposed workaround to get "{dummyStickToken}" passed over is to pre-encode it and then use buildFromEncoded call is actually what needs to be done - this will avoid a double '%' encoding. A minor fix to UriBuilder to ensure IAE is thrown needs to be done in meantime. Note a test exists for a case where at least two template values are provided but not all have been substituted via build or buildFromEncoded, but some buggy optimization in UriBuilder implementation misses on a case where only a single query template var is provided and left non-substituted - and it already works as expected for path segment variables > Encoding issue jax-rs - UriBuilder > ---------------------------------- > > Key: CXF-4861 > URL: https://issues.apache.org/jira/browse/CXF-4861 > Project: CXF > Issue Type: Bug > Affects Versions: 2.6, 2.7.0 > Reporter: Stephan Klevenz > > Use Case: OData (odata.org) / odata4j (odata4j.org) > Building an URI based on OData query parameter: > URI called by http client: .../Employees?$filter=startswith(CarrierId,'A') > URI build on server: > String nextHref = uriInfo.getRequestUriBuilder().replaceQueryParam("$skiptoken", "{dummySkipToken}").build().toString(); > Result is: > /Employees?$filter=startswith%2528CarrierId%252C%2527A%2527%2529&$skiptoken=%7BdummySkipToken%7D > The value of query parameter $filter is encoded twice. The issue is in the embrasing {} of the value of the $skiptoken query parameter. > CXF does a partial encoding of the first query parameter which succeeds and then gets a UriSyntaxException for the 2nd query parameter. After that it falls back and encodes the whole URI while the 1st query option is already encoded. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira