Forum Discussion
mahern_56900
Nimbostratus
Nov 11, 2009Add exception to response rewrite
Hi,
We are using the following irule to rewrite the headers and body of an old application:
when HTTP_REQUEST {
initialize a var
set check_response 0 ...
mahern_56900
Nimbostratus
Nov 11, 2009The input hidden to avoid is:
And the irule code is:
when HTTP_REQUEST {
Inicializamos una variable para comprobar si tenemos que reescribir las cabeceras/contenido
set check_response 0
Comprobamos si el path es el que buscamos
if {[HTTP::uri] starts_with "/nilo"} {
Ponemos la variable a 1 para actuar en las cabeceras/contenido
set check_response 1
}
}
when HTTP_RESPONSE {
Comprobamos que no escribimos una cabecera que no debemos
if {$check_response}{
Comprobamos si la cookie JSESSIONID existe
if {[HTTP::cookie exists JSESSIONID]}{
Establecemos el path de la cookie a /sdr/nilo
HTTP::cookie path JSESSIONID "/sdr/nilo"
}
Comprobamos si la peticion es text
if {[HTTP::header value Content-Type] contains "text"} {
Establecemos el texto a reemplazar y activamos el filtro stream
STREAM::expression {@/nilo/@/sdr/nilo/@}
STREAM::enable
} else {
En las respuestas que no son text, desactivamos el filtro stream
STREAM::disable
}
}
}
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