On Fri, Jul 25, 2014 at 10:32 AM, Tadeas Kriz <tkriz@redhat.com> wrote:


Tadeas Kriz

On 24 Jul 2014, at 05:44 pm, Karel Piwko <kpiwko@redhat.com> wrote:

> On Thu, Jul 24, 2014 at 3:28 PM, Tadeas Kriz <tkriz@redhat.com> wrote:
>>
>> It should not. For hibernate, it’s just a string like any other.
>> The problem might be in the configuration of JAX.RS/RestEasy. If
>> I’ll have some time today evening, I’ll try to fix it, it should
>> be an easy fix.
>
> Last famous words? ;-)
>

I shall never say “an easy fix” again.

> But I agree. Everything is string and URL encode should happen on
> client while server should automatically decode and work always with
> just decoded string. If we need to encode twice, something is wrong.
>

Anyway, the 400 Bad request response is made by the tomcat itself, disallowing the use of %2F as a path parameter. This will probably apply on other web containers.

Possible solutions with their disadvantages:

1. well-documented double-encoding of the URL (might be confusing)

well, yeah :) that would be my choice; even if it sucks
 
2. use @QueryParam instead of @PathParam (breaks the api consistence, as every other call would still use @PathParam)
3. allow @QueryParam (again, breaks the api consistence, but only for the SimplePush)

-1 on any API chagne
 
4. find another encoding (Base64 for URL = URLEncode then Base64 encode)

not sure 
 
5. don’t use the url as a deviceToken (might not comply with Mozzila’s SimplePush specs)

does dan's regex work (for all platforms), I'd vote for that, otherwise option 1


-M
 

What do you think guys?

>>
>>
>
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev


_______________________________________________
aerogear-dev mailing list
aerogear-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf