3 Replies Latest reply on Oct 6, 2014 5:45 AM by rishikesh_darandale

    If Cookie value is JSON string, then it is not getting parsed correctly

    rishikesh_darandale

      When the cookie with JSON object is sent to wildfly 8.1 container, then it is not getting parsed correctly. If that JSON string has '=', then undertow is throwing IllegalArgument Exception.

       

      Here is sample cookie with value:

       

      sample={"v2":-2,"v1":1,"rid":"d046012-55070443-84d7-15d6-473f3","ru":"http://myapplication.com/test","r":"mydomain.com","st":"", "c":"http://mydomain.com/search=testme","pv":1,"lc":{"d2":{"v":1,"s":false}},"cd":2,"cp":{"usrSessionID":"some_unique_value","MPS":seen"}}


      Exception:

      Caused by: java.lang.IllegalArgumentException: Cookie name ":-2,"v1":1,"rid":"d046012-55070443-84d7-15d6-473f3","ru":"http://myapplication.com/test","r":"mydomain.com","st":"", "c":"http://mydomain.com/search" is a reserved token


      I have put a solution[1] in undertow core, can somebody review and let me know the feedback.


      Thanks

      Rishi

      [1] [undertow-core] Added a support to read the cookie value as JSON object · ff3fd13 · RishikeshDarandale/undertow · GitHu…