Forum Discussion
Bartek
Cirrus
Apr 11, 2025Replace stream if condition is met
Hi - I have an iRule i need to draft, however I can only test it once it drafted, by sending it to my customer for testing... bummer. So the problem is - I need to inject my .js in the body of the...
Bartek
Cirrus
Apr 12, 2025I'm trying to avoid collecting the payload.
I actually realized I know exactly how does the payload look like without my insert... So i made a simple stream::expression that adds to the known payload.
something like this:
when HTTP_REQUEST {
STREAM::disable
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
if { [HTTP::header exists "Content-Type"] && [HTTP::header value "Content-Type"] contains "text/html" } {
if { [HTTP::header exists "Content-Length"] } {
HTTP::header remove "Content-Length"
}
STREAM::expression {@"module"></script></body>@"module"><script type="text/javascript" src="/secfense/js/eru.js"></script></body>@}
STREAM::enable
}
}
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