cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CXF-6015) Path parameters containing semicolon are truncated due to missing encoding
Date Thu, 25 Sep 2014 13:21:33 GMT

    [ https://issues.apache.org/jira/browse/CXF-6015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14147720#comment-14147720
] 

Daniel edited comment on CXF-6015 at 9/25/14 1:21 PM:
------------------------------------------------------

[~sergey_beryozkin] thanks for taking care of this issue!

Will all String parameters be escaped if {{url.encode.client.parameters}} is set to {{true}}
including {{@HeaderParam}}? I think this problem is not valid for {{HeaderParams}} as these
parameters don't need to be encoded/decoded and will not be decoded automatically in the JAX-RS
service.


was (Author: dpr):
[~sergey_beryozkin] thanks for taking care of this issue!

Will all String parameters be escaped if {{url.encode.client.parameters}} is set to {{true}}
including {{@HeaderParam}}? I think this problem is not valid for {{HeaderParams}} as these
parameters don't need to be encoded/decoded.

> 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
>            Assignee: Sergey Beryozkin
>             Fix For: 3.0.2, 3.1.0
>
>         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&uuml;diger/R&uuml%3Bdiger}}
will result in {{anAttribute=R&uuml, anotherAttribute=R&amp;uuml;diger}} to be returned.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message