Gatling Version 2.2.3 does not decode Base64 containing backslashes

We read responses that contain GZipped Base64 encoded Json that have newline characters in them (e.g. H4sIAAAAAAAAAO3LMREAMAgEMEM44t4B1w3/eOicJVu6387UHynbtm3btm3btm3btm3btm3btm3b\r\ntm3btm3btm07OTPyQd2LJQAA)

Reading, stripping whitespaces, decoding and unzipping these works in Gatling 2.2.1, but fails in 2.2.3 with a illegal argument exception:


12:47:40.497 [ERROR] i.g.c.a.b.SessionHookBuilder$$anon$1 - ‘hook-4’ crashed with ‘java.lang.IllegalArgumentException: Illegal base64 character 5c’, forwarding to the next one


I’ve attached a Gatling simulation that reproduces this, as well as the php file the script calls.



mytest.scala (1.84 KB)

gatlingtest.php (216 Bytes)

Not really an issue, more of a lack of documentation on a corner case.
Since #3093, JsonPath.ofType[String] returns valid JSON so it can be posted back to the server, meaning that the \n in you JSON payload is now saved this way and no longer decoded.
You have to change your code.