Skip to content

Instantly share code, notes, and snippets.

@simon-engledew
Created March 19, 2015 11:45
Show Gist options
  • Save simon-engledew/b2a301c5d1da582d93c8 to your computer and use it in GitHub Desktop.
Save simon-engledew/b2a301c5d1da582d93c8 to your computer and use it in GitHub Desktop.
Tsung 1.5 + Rails Authenticity Token + URI encoding
<!-- You need to transform Val from a binary to a list and back again -->
<setdynvars sourcetype="eval" code="fun({Pid,DynVars})->
{ok, Val} = ts_dynvars:lookup(authenticity_token, DynVars),
list_to_binary(http_uri:encode(binary_to_list(Val)))
end.">
<var name="escaped_authenticity_token" />
</setdynvars>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment