I have the following iRule
However sometimes we receive the following error
Do you know why?
May 20 10:56:32 tmm tmm[1019]: 01220001:3: TCL error: Rule refresh_to_redirect_4 - Operation not supported (line 8) invoked from within “HTTP::header replace “Connection” “Keep-Alive””
iRule to convert meta refresh statements to 302s
when HTTP_REQUEST
{
if {[HTTP::uri] contains “.pt?”}
{
set checkContents 1
if {[HTTP::version] eq “1.1”}
{
if { [HTTP::header is_keepalive] }
{
HTTP::header replace “Connection” “Keep-Alive”
}
HTTP::version “1.0”
}
}
else
{
set checkContents 0
}
}
when HTTP_RESPONSE
{
if {($checkContents>0) and ([HTTP::header Content-Type] starts_with “text/html”) and ([HTTP::header exists “Content-Length”])}
{
set content_length [HTTP::header “Content-Length”]
if {($content_length>=400) and ($content_length<=600)}
{
HTTP::collect $content_length
}
else
{
set checkContents 0
}
}
}
when HTTP_RESPONSE_DATA
{
if {($checkContents>0) and ([HTTP::payload] contains "meta HTTP-EQUIV=\“REFRESH\” CONTENT=\“0;”)}
{
set urlresponse [findstr [HTTP::payload] “URL=” 4 {">}]
if {$urlresponse!=“”}
{
HTTP::payload replace 0 $content_length [format “” $urlresponse]
HTTP::release
}
}
}