Re: Percent encoded string in @QueryParam

2016-03-10 Thread Sergey Beryozkin
Briefly returning to this thread and clarify why I'm asking to check Jersey UriBuilder or perhaps, even better JAX-RS 2.0 Client API with Jersey and the way the certain combinations are treated: - double encoding of URI (Path, Query) parameters. - double encoding of Form parameters. - treatment

Re: Percent encoded string in @QueryParam

2016-03-08 Thread Sergey Beryozkin
I'm not going to repeat most of what I've already said few times in this thread but only state again that CXF proxies depend on JAX-RS UriBuilder and therefore UriBuilder dictates how %-encoded query (and other) parameters get processed. This is a won't fix 'issue'. However I also mentioned

Re: Percent encoded string in @QueryParam

2016-03-08 Thread Volkov Sergey
I agree that UriBuilder implements what is states. Such values are allowed in the query representations. The UriBuilder > does not know what the intention of the CXF proxy user is, it may have > an encoded representation of a given character stored in the DB and > wants to pass it as is via the

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Sergey Beryozkin
Please forget about CXF proxies. It is down to UriBuilder. http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/UriBuilder.html states: 'Percent encoded values are also recognized where allowed and will not be double encoded.' Such values are allowed in the query representations. The

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Sergey Beryozkin
I see a test like this: @Test public void testClonePctEncoded() throws Exception { URI uri = new URI("http://bar;); URI newUri = new UriBuilderImpl(uri) .path("{a}").path("{b}") .matrixParam("m", "m1 ", "m2+%20") .queryParam("q", "q1 ",

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Volkov Sergey
i.e CXF proxy do not urlencode parameters? (Instead of it use org.apache.cxf.jaxrs.utils.HttpUtils#encodePartiallyEncoded encoding which is not reversible) And the only reason of this encoding is to avoid reports about correctly encoded parameters? As I said, CXF proxy runtime uses JAX-RS

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Sergey Beryozkin
Can you experiment with JAX-RS RI UriBuilder and double check that passing to it a query parameter like "%DE" will not encode it ? I'm pretty sure they won't. I have done a lot of work with UriBuilder to make sure it passed JAX-RS 1.1 and the early 2.0 TCK that was available to Apache. So I'd

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Sergey Beryozkin
As I said, CXF proxy runtime uses JAX-RS UriBuilder. And UriBuilder does not touch valid percent-encoded representations. And this is how the RS client runtime will continue operating. Sergey On 04/03/16 10:45, Volkov Sergey wrote: "100%25BETTER VALID STRING" instead of "100%BETTER

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Volkov Sergey
Actually correctly encoded strings are 100%25BETTER+VALID+STRING and "100%25VALID+STRING" 2016-03-04 13:45 GMT+03:00 Volkov Sergey : > "100%25BETTER VALID STRING" >> >> instead of >> >> "100%BETTER VALID STRING" >> > > "100%25BETTER VALID STRING" is correct way to

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Volkov Sergey
> > "100%25BETTER VALID STRING" > > instead of > > "100%BETTER VALID STRING" > "100%25BETTER VALID STRING" is correct way to urlencode "100%BETTER VALID STRING" - so actually CXF is over-smart now, when it skips all %xx sequence instead of encode % as %25 "100%VALID STRING" at the moment encodes

Re: Percent encoded string in @QueryParam

2016-03-04 Thread Sergey Beryozkin
In the former case it it has no characters that can be used to form the hex %-encoded representations. The bottom line is, you should not expect the runtime auto-encode '%' given that this symbol plays a special role in having correct URIs being created. If CXF will try to me over-smart

Re: Percent encoded string in @QueryParam

2016-03-03 Thread Volkov Sergey
Looks like POST request and @FormParam could be used, but I think this behavior of @QueryParam may lead to tricky bugs in many places where it used 2016-03-04 10:37 GMT+03:00 Volkov Sergey : > Yes, I don't understand why it does not touch this sequences. > > It's a bit

Re: Percent encoded string in @QueryParam

2016-03-03 Thread Volkov Sergey
Yes, I don't understand why it does not touch this sequences. It's a bit strange because I can successfully transfer "100%VALID STRING" but not "100%BETTER VALID STRING" Both this string not percent encoded, but second contains %BE which just looks like percent encoded. If instead of

Re: Percent encoded string in @QueryParam

2016-03-03 Thread Sergey Beryozkin
If you are saying that when you pass something like "%D1%82", or to make it clearer, "%D1" and expect CXF do "%25D1", then no, it won't work. UriBuilder does not touch percent-encoded sequences %XX. May be try building the query with UriBuilder before passing it to the proxy, something like

Re: Percent encoded string in @QueryParam

2016-03-03 Thread Sergey Beryozkin
I am a bit confused. If you pass "%25D1%2582" and have @Encoded then you will have "%25D1%2582" made available to the service. Sergey On 03/03/16 18:09, Volkov Sergey wrote: So currently there no way to pass both Cyrillic "т" as "т" (coded as "%D1%82" in url ) and "%D1%82" as "%D1%82" (coded

Re: Percent encoded string in @QueryParam

2016-03-03 Thread Volkov Sergey
So currently there no way to pass both Cyrillic "т" as "т" (coded as "%D1%82" in url ) and "%D1%82" as "%D1%82" (coded as "%25D1%2582") from client to server using proxy? Should I create issue about that? 2016-03-03 20:52 GMT+03:00 Sergey Volkov : > if you use Http centric

Re: Percent encoded string in @QueryParam

2016-03-03 Thread Sergey Beryozkin
if you use Http centric API then indeed you can have @Encode on service interfaces but pass %D1%82 directly to 2.0 Client API or WebClient. If you have a proxy: it actually does not do @Encode processing either - the reason is that it is irrelevant for the proxy, it uses

Percent encoded string in @QueryParam

2016-03-03 Thread Volkov Sergey
Hi! There was issue https://issues.apache.org/jira/browse/CXF-6122 that + was not working in QueryParam I have quite similar issue - but I can't pass percent encoded string in query params: When I pass string "т" (Cyrillic symbol) to generated client in encodes to "%D1%82" in url and decodes as