tsung
tsung copied to clipboard
Is there a way to follow 307 redirects?
The docs, give an example of following 302 or 301 redirects (http://tsung.erlang-projects.org/user_manual/faq.html#can-i-dynamically-follow-redirect-with-http) howwever a 307 is supposed to contain the body too.
here is my example for your reference:
<transaction name="http_req">
<request subst="true">
<dyn_variable name="newurl" re="Location: (.*)\r"/>
<dyn_variable name="domain" re="Location: ([^/]*).*\r"/>
<http url="/index.html" method="GET" version="1.1">
<http_header name="Host" value="www.pre-redirect-site.com"/>
</http>
</request>
<if var="newurl" neq="">
<repeat name="redirect_loop" max_repeat="5">
<request subst="true">
<dyn_variable name="newurl" re="Location: (.*)\r"/>
<dyn_variable name="domain" re="Location: ([^/]*).*\r"/>
<http url="%%_newurl%%" method="GET" version="1.1">
<http_header name="Host" value="%%_domain%%"/>
</http>
</request>
<until var="newurl" eq=""/>
</repeat>
</if>
</transaction>