craff_17758
Sep 25, 2007Historic F5 Account
iRule stopped working with upgrade to 9.4.1
All,
I've been going over this iRule for a while, and I don't see what broke.
This iRule worked in version 9.2.3, but stopped doing its job in 9.4.1. The purpose of the rule is to translate filename extensions in requests and re-translate them on the way back out. (The middle part for selecting a pool reputedly works fine.)
Did something change in the implementation of the TCL 'string map' implementation?
rule Open_Redirect {
when HTTP_REQUEST {
set uri [HTTP::uri]
log local0. "greg test 1"
if { [string tolower [HTTP::uri]] contains ".osp" } {
replace remote_addr with .ospx -> .aspx and .osp -> .asp
set uri [string map -nocase {.ospx .aspx .osp .asp} $uri]
Set target uri to the version after the replaces have been run
HTTP::uri $uri
}
if { [string tolower [HTTP::uri]] contains "server72" } {
persist none
use pool Delphi-Apps_Server72
} elseif { [string tolower [HTTP::uri] ] contains "server75" } {
persist none
log local0. "Server 75"
use pool Delphi-Apps_Server75
} elseif { [string tolower [HTTP::uri] ] starts_with "/apps/reportengine"
or [string tolower [HTTP::uri] ] starts_with "/crystalreportviewers115"
or [string tolower [HTTP::uri] ] starts_with "/apps/crbroker" } {
use pool Delphi-Apps_Server72
} elseif { [string tolower [HTTP::uri] ] starts_with "/apps"
or [string tolower [HTTP::uri] ] starts_with "/crystalreportviewers11"
or [string tolower [HTTP::uri] ] starts_with "/businessobjects"
or [string tolower [HTTP::uri] ] starts_with "/leaseadmin"
or [string tolower [HTTP::uri] ] starts_with "/resources/apps/portfoliotracker" } {
use pool Delphi-Apps
} elseif { [string tolower [HTTP::uri] ] starts_with "/redsau"
or [string tolower [HTTP::uri] ] starts_with "/resources/apps/reportengine"
or [string tolower [HTTP::uri] ] starts_with "/crystalreportviewers10" } {
use pool DelphiAppStage
} elseif { [string tolower [HTTP::uri] ] contains "server85" or [HTTP::cookie exists "cookie85"]} {
persist none
use pool Delphi_Portal_Server85
} elseif { [string tolower [HTTP::uri]] contains "server10" } {
persist none
use pool Delphi_Portal_Server10
} elseif { [string tolower [HTTP::uri] ] contains "server14" } {
persist none
log local0. "Server 14"
use pool Delphi_Portal_Server14
} else
{
use pool Delphi-Portal
}
}
when HTTP_RESPONSE {
log local0. "gregtest1"
set location [HTTP::header value Location]
log local0. "OPEN: Location-> $location"
HTTP::header replace Location [string map -nocase {2easpx 2eospx .aspx .ospx .asp .osp delphilil.am open.am} [HTTP::header value Location]]
STREAM::enable
STREAM::expression "@\\.asp@.osp@ @\\.aspx@.ospx@ @delphilil\\.am@open.am@"
}
}