users@jersey.java.net

Base64 problem (I guess)

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Wed, 7 Oct 2009 20:04:36 +0200

I have this confirmation email, with an a URL containing a hashed key...

http://fgaucho.dyndns.org:8080/arena-dwr/confirm?key=JkOgm11BWssuU3e%2Fnt23GYr4gQeLCHu344VhBQaV3%2BhPgrMl1AhnGA%3D%3DJkOgm11BWssuU3e%2Fnt23GYr4gQeLCHu344VhBQaV3%2BhPgrMl1AhnGA%3D%3D

it works if I click on the email URL, normally..

but, I am trying to simulate the same behaviou in a Unit Test class,
using the Jersey Client.

        public int confirmRegistration() throws IOException {
                Form formData = new Form();
                formData
                                .add(
                                                RegistrationConstants.CONFIRMATION_KEY.value(),
                                                "JkOgm11BWssuU3e%2Fnt23GYr4gQeLCHu344VhBQaV3%2BhPgrMl1AhnGA%3D%3DJkOgm11BWssuU3e%2Fnt23GYr4gQeLCHu344VhBQaV3%2BhPgrMl1AhnGA%3D%3D");
                ClientResponse response = arena.path("user").type(
                                "application/x-www-form-urlencoded").post(ClientResponse.class,
                                formData);
                return response.getStatus();
        }


Problem is: my deobfuscator method throw an invalid key exception ...

I guess it is because the Base64 and URLEnconder applied by the
browser, but I am not sure what the Jersey Client do with the form
parameters before to send it to the server...

any help is welcome........



-- 
Looking for a client application for this service:
http://fgaucho.dyndns.org:8080/arena-http/wadl