decode cookie in test scenario

Hello,

I have to decode a cookie before sent it to server. But this code does nothing and cookie stay encode :

val scn = scenario("sc2") .exec(http("request_6") .post("/livelink/livelink.exe") .headers(headers_6) .formParam("func", "ll.login") .formParam("CurrentClientTime", "D/2017/7/31:14:10:50") .formParam("NextURL", "/livelink/livelink.exe?Redirect=1") .check(headerRegex("Set-Cookie", "LLCookie=(.*?);").find.saveAs("cookieRequest")) .resources(http("request_7") .get("/livelinksupport/style/screen.css") .headers(headers_1), http("request_8") .get("/livelinksupport/core/otfunc.css") .headers(headers_1), http("request_33") .get("/node/sncfrhome/shortcuts") .headers(Map("LLCookie" -> decode("${cookieRequest}"))), http("request_34")

Do you have an idea ?

Thanks for your help.

I find answer :

`
def decode(s: String): String = URLDecoder.decode(s, “UTF-8”)

`
val scn = scenario(“sc2”)
.exec(http(“request_6”)
.post("/livelink/livelink.exe")
.headers(headers_6)
.formParam(“func”, “ll.login”)
.formParam(“CurrentClientTime”, “D/2017/7/31:14:10:50”)
.formParam(“NextURL”, “/livelink/livelink.exe?Redirect=1”)
.check(headerRegex(“Set-Cookie”, “LLCookie=(.*?);”).transform(token => decode(token)).saveAs(“cookieRequest”))
.resources(http(“request_7”)
.get("/livelinksupport/style/screen.css")
.headers(headers_1),
http(“request_8”)
.get("/livelinksupport/core/otfunc.css")
.headers(headers_1),
http(“request_33”)
.get("/node/sncfrhome/shortcuts")
.headers(Map(“LLCookie” → “${cookieRequest}”)),
http(“request_34”)

`

`