Tsung development
  1. Tsung development
  2. TSUN-70

Make HTTP plugin optionally follow redirects

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.3.0
    • Component/s: HTTP plugin
    • Labels:
    • Environment:
      Linux

      Description

      An option should exist on the http element to allow redirects and the max number of redirects to follow. The result obtained from the http plugin should be the destination page.

      There are scenarios involving logins that require a flow to be followed and this would enable tsung to be used this way as well.

        Activity

        Hide
        Nicolas Niclausse
        added a comment -

        Using the upcoming 1.3.0 release, you can use <repeat> and dynamic variable to achieve this:

        <request>
        <dyn_variable name="redirect" regexp="Location: (http://.*&#41;\r"/>
        <http url='/test/redirect1.html' method='GET'></http>
        </request>

        <repeat name="redirect_loop" max_repeat="5">
        <request subst="true">
        <dyn_variable name="redirect" regexp="Location: (http://.*&#41;\r"/>
        <http url="%%_redirect%%" method="GET"></http>
        </request>
        <until var="redirect" eq=""/>
        </repeat>

        Does it fit your needs ?

        Show
        Nicolas Niclausse
        added a comment - Using the upcoming 1.3.0 release, you can use <repeat> and dynamic variable to achieve this: <request> <dyn_variable name="redirect" regexp="Location: ( http://.*&#41;\r "/> <http url='/test/redirect1.html' method='GET'></http> </request> <repeat name="redirect_loop" max_repeat="5"> <request subst="true"> <dyn_variable name="redirect" regexp="Location: ( http://.*&#41;\r "/> <http url="%%_redirect%%" method="GET"></http> </request> <until var="redirect" eq=""/> </repeat> Does it fit your needs ?
        Hide
        André Cruz
        added a comment -

        Looks like it. We only need the last block, right?

        Show
        André Cruz
        added a comment - Looks like it. We only need the last block, right?

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              5 years, 34 weeks, 2 days ago

              Issue deployment