Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

allow substitutions on cookies #11

Merged
merged 1 commit into from

2 participants

@thomasc

No description provided.

@nniclausse nniclausse merged commit 83f2e12 into processone:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 24, 2012
  1. @thomasc

    allow substitutions on cookies

    thomasc authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/tsung/ts_http.erl
View
8 src/tsung/ts_http.erl
@@ -224,12 +224,18 @@ init_dynparams() ->
%% request parameters.
%% @end
%%----------------------------------------------------------------------
-subst(Req=#http_request{url=URL, body=Body, headers = Headers, userid=UserId, passwd=Passwd}, DynData) ->
+subst(Req=#http_request{url=URL, body=Body, headers = Headers, cookie = Cookies,
+ userid=UserId, passwd=Passwd}, DynData) ->
Req#http_request{url = escape_url(ts_search:subst(URL, DynData)),
body = ts_search:subst(Body, DynData),
headers = lists:foldl(fun ({Name, Value}, Result) ->
[{Name, ts_search:subst(Value, DynData)} | Result]
end, [], Headers),
+ cookie = lists:foldl(
+ fun (#cookie{ value = Value } = C, Result) ->
+ [C#cookie{ value = ts_search:subst(Value, DynData) }
+ | Result]
+ end, [], Cookies),
userid = ts_search:subst(UserId, DynData),
passwd = ts_search:subst(Passwd, DynData)}.
Something went wrong with that request. Please try again.