Index: openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl,v diff -u -r1.79.2.1 -r1.79.2.2 --- openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 15 Mar 2019 08:59:18 -0000 1.79.2.1 +++ openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 26 Mar 2019 09:22:54 -0000 1.79.2.2 @@ -1152,6 +1152,7 @@ {-session ""} {-body} {-timeout 10} + {-depth 1} {-headers ""} {-prefix ""} {-verbose:boolean 1} @@ -1161,6 +1162,9 @@ Run an HTTP request against the actual server inside test cases. + @param depth follow redirects up to specified depth. Default + means redirects won't be followed. + @author Gustaf Neumann } { ns_log notice "::acs::test::http -user_id $user_id -user_info $user_info request $request" @@ -1259,11 +1263,20 @@ # try { ns_log notice "acs::test:http client request (timeout $timeout): $method $url" - set d [ns_http run \ - -timeout $timeout \ - -method $method \ - {*}$extra_args \ - $url] + set location $url + while {$depth > 0} { + incr depth -1 + set d [ns_http run \ + -timeout $timeout \ + -method $method \ + {*}$extra_args \ + $location] + set status [dict get $d status] + set location [ns_set iget [dict get $d headers] location] + if {![string match "3??" $status] || $location eq ""} { + break + } + } } finally { # # always reset after the reqest the login data nsv