Forum Discussion
Andy_McGrath
Nov 29, 2017Cumulonimbus
The key to this is saving info from the Request so you can use it in the Response. Things like the HTTP Host and requested URI are lost on response, example:
when HTTP_REQUEST {
set host [HTTP::host]
set uri [HTTP::uri]
}
when HTTP_RESPONSE {
if {$uri starts_with "/stuff" &&
[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@foo.com@foo.com/bar@}
STREAM::enable
}
}
Not complete iRule but hope it helps.