dennypayne
May 20, 2009Employee
Command ordering with stream profile
Hi all,
Does anyone have any explanations as to why the order of commands matters here?
Using the HTTP_RESPONSE event below:
when HTTP_REQUEST {
save original hostname and place it in xHost header
set orighost [HTTP::host]
HTTP::header insert "xHost" $orighost
see if vchannel was requested (ie, last char of hostname is v, ignoring the .example.com)
set boxname [string tolower [getfield [HTTP::host] "." 1]]
if { $boxname ends_with "v" } {
set channel "v"
} else {
set channel ""
}
build the new Host header and $WSSN header
HTTP::header replace "Host" rwa$channel.example.com
HTTP::header replace "\$WSSN" rwa$channel.example.com
make sure all cookies use wildcard of .example.com as their domain
foreach N [HTTP::cookie names] {
HTTP::cookie domain $N .example.com
}
}
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Replace any instance of rw*.example.com with original Host header
STREAM::expression "@rw.*?.example.com@$orighost@"
Enable the stream filter for this response only
STREAM::enable
}
make sure all cookies use wildcard of .example.com as their domain
foreach N [HTTP::cookie names] {
HTTP::cookie domain $N .example.com
}
}
The page stalls and never loads. No errors are thrown in /var/log/ltm either.
But if the order is changed to:
when HTTP_RESPONSE {
make sure all cookies use wildcard of .example.com as their domain
foreach N [HTTP::cookie names] {
HTTP::cookie domain $N .example.com
}
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Replace any instance of rw*.example.com with original Host header
STREAM::expression "@rw.*?.example.com@$orighost@"
Enable the stream filter for this response only
STREAM::enable
}
}
Then the page loads normally. Should stream operations always come last in an event? Thoughts?
Denny