You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2016/03/08 17:56:41 UTC

Why proxies encode '+' query parameters

>>
>> "+" value also allowed in query representation, but is encoded for some
>> reason by UriBuilder. So there would be problems with stored in db values
>> if they contains "+"
>>
>> I'm not using jerecy, only
>> org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean to create proxies.
>>
>> I found https://issues.apache.org/jira/browse/CXF-6015 and
>> "url.encode.client.parameters" property, but because
>> org.apache.cxf.jaxrs.client.UrlEncodingParamConverter encodes space as
>> "+",
>> and "+" is encoded as "%2B" by UriBuilder it's also not very useful
>> (Sequence like "+ +" would be converted to "%2B%2B%2B" and decoded as
>> "+++") Also it double encodes @FormParam values.
>>
>>

Re: Why proxies encode '+' query parameters

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 08/03/16 17:16, Sergey Beryozkin wrote:
> On 08/03/16 16:56, Sergey Beryozkin wrote:
>>>>
>>>> "+" value also allowed in query representation, but is encoded for some
>>>> reason by UriBuilder.
>
> Well, this is not CXF specific.
>
>> So there would be problems with stored in db
>>>> values
>>>> if they contains "+"
>>>>
>>>> I'm not using jerecy, only
>>>> org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean to create proxies.
>>>>
>>>> I found https://issues.apache.org/jira/browse/CXF-6015 and
>>>> "url.encode.client.parameters" property, but because
>>>> org.apache.cxf.jaxrs.client.UrlEncodingParamConverter encodes space as
>>>> "+",
>>>> and "+" is encoded as "%2B" by UriBuilder it's also not very useful
>>>> (Sequence like "+ +" would be converted to "%2B%2B%2B" and decoded as
>>>> "+++")
>
> Look, I accept there could be some strange combination that are expected
> to go one way to the wire while the users expects something different.
> We do out best to accommodate various user requirements, and
> "url.encode.client.parameters" was one of such steps. If using it
> creates something unexpected in your case then don't use it.
> If you have a server that wants to really wants to see "+ " after the
> request has been decoded then encode "+ " as "%2B%29" and be done with it
"%2B%20"
>
>>>>
>>>>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: Why proxies encode '+' query parameters

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 08/03/16 16:56, Sergey Beryozkin wrote:
>>>
>>> "+" value also allowed in query representation, but is encoded for some
>>> reason by UriBuilder.

Well, this is not CXF specific.

> So there would be problems with stored in db
>>> values
>>> if they contains "+"
>>>
>>> I'm not using jerecy, only
>>> org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean to create proxies.
>>>
>>> I found https://issues.apache.org/jira/browse/CXF-6015 and
>>> "url.encode.client.parameters" property, but because
>>> org.apache.cxf.jaxrs.client.UrlEncodingParamConverter encodes space as
>>> "+",
>>> and "+" is encoded as "%2B" by UriBuilder it's also not very useful
>>> (Sequence like "+ +" would be converted to "%2B%2B%2B" and decoded as
>>> "+++")

Look, I accept there could be some strange combination that are expected 
to go one way to the wire while the users expects something different. 
We do out best to accommodate various user requirements, and
"url.encode.client.parameters" was one of such steps. If using it 
creates something unexpected in your case then don't use it.
If you have a server that wants to really wants to see "+ " after the 
request has been decoded then encode "+ " as "%2B%29" and be done with it

>>>
>>>