Forum Discussion
commsmonkey_172
Oct 03, 2011Nimbostratus
Hi Hoolio,
I'm not quite sure how that works.
I've taken another tact given the new insights herein.
The new issue I'm having is my string replacement does not appear to be functioning, my redirect appears to remain unvaried
When STREAM_MATCHED {
Insert $myVar to the URI component of the HREF following
the junction /Junction/ for subsequent ingress processing
set myVar [string tolower [getfield [STREAM::match] "." 1]]
STREAM::replace "external.domain.name/Junction/$myVar/"
}when HTTP_REQUEST {
Disable the stream filter for all requests via VS
STREAM::disable
Check URI for part of myVar (nodename01 to nodename19)
if {[HTTP::uri] contains "nodename"}{
set myVarCookie [getfield [HTTP::uri] "/" 3]
Set & Insert Cookie for processing
HTTP::cookie insert name "EV" value $myVar path "/"
Redirect client for processing by the Internal VS
ideally the preceding / needs to be removed after myVar as well
HTTP::redirect [string map {$myVar ""} [HTTP::uri]]
}
}
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
Enable the stream filter for text responses only
if {[HTTP::header value Content-Type] contains "text"}{
Find the value I want to change, but manage change in STREAM_MATCHED
STREAM::expression {@string@@}
Enable the stream filter for this response only
STREAM::enable
}
}