[tclwebtest] Forced 301 redirection
Status: Abandoned
Brought to you by:
tils
From: Grzegorz A. H. <gr...@ef...> - 2003-02-06 11:41:55
|
Hi. This patch allows following 301 redirections with -nocomplain, otherwise assertion_failed is called. Index: tclwebtest.tcl =================================================================== RCS file: /home/maincvs/efintranet/www/tclwebtest/prog/tclwebtest.tcl,v retrieving revision 1.18 diff -u -r1.18 tclwebtest.tcl --- tclwebtest.tcl 6 Feb 2003 11:03:23 -0000 1.18 +++ tclwebtest.tcl 6 Feb 2003 11:37:07 -0000 @@ -1902,11 +1902,18 @@ # is it a redirect ? - if { $http_status == "302" } { + if { $http_status == "302" || $http_status == "301" } { for { set i 0 } { $i < [llength $meta] } { incr i 2 } { if { [string match -nocase [lindex $meta $i] "location"] } { set location [lindex $meta [expr $i+1]] break + } + } + if { $http_status == "301" } { + if $nocomplain_p { + log "Attention! Redirection 301 was ignored, but please update your test unit, it's a bug!" + } else { + assertion_failed "Permanent redirection (301) are considered a test unit bug\nUse -nocomplain if needed." } } if $noredirect_p { -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |