Forum Discussion
Gerardo_Garcia_
Nimbostratus
May 21, 2008meta refresh to 302s
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
}
}
}
2 Replies
Sort By
- Colin_Walker_12Historic F5 AccountOff the top of my head I'd guess that some of the traffic is missing a Connection header and the command is erroring out with a message that's less than appropriate. I'd try adding some logging statements around the line in question to see what's coming through when you see those errors.
- hoolio
Cirrostratus
I think HTTP::header replace will just insert the header if it doesn't exist already and not generate an error. Iis there another iRule on the VIP which is issuing a redirect or otherwise conflicting with the HTTP header replace command?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects