Sounds like a bug. What version of Jetty are you testing with? Seeing the signature of createWebSocket(UpgradeRequest, UpgradeResponse) i think you are on 9.0.5, but I just want to make sure.
-- Joakim Erdfelt <[email protected]> webtide.com <http://www.webtide.com/> - intalio.com/jetty Expert advice, services and support from from the Jetty & CometD experts eclipse.org/jetty - cometd.org On Sun, Sep 29, 2013 at 10:39 PM, Daniel Wu <[email protected]> wrote: > Hi guys, > > I tried to create my websocket object with my own WebSocketCreator. The > connect url has a couple of query parameters, one of them contains a base64 > encoded HMAC string. > The problem is, the HMAC string sometimes contains '+', I encoded it as > '%2B' in the query parameter. > > e.g, ws://localhost/api?hmac=He%2BB3gwJBRGleMb02i8RMvhpHTo%3D > > When I get the value from the WebSocketCreator, the encoded '%2B' becomes > space. I guess it's wrongly decoded twice, it's first decoded as '+', then > decoded as space. Below is the test code: > > public Object createWebSocket(UpgradeRequest request, UpgradeResponse > repsponse) { > Map<String, String[]> parameters = request.getParameterMap(); > String hmacFromQuery = parameters.get("hmac")[0]; > > But it works with servlet, e.g, > http://localhost/test?hmac=He%2BB3gwJBRGleMb02i8RMvhpHTo%3D > You will get the correct '+' in the query string. > > I searched eclipse bug database but did not find any related bugs about > this. Does anybody encounter the same problem? > > -- > Daniel Wu > Sent with Sparrow <http://www.sparrowmailapp.com/?sig> > > > _______________________________________________ > jetty-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/jetty-users > >
_______________________________________________ jetty-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/jetty-users
