08-Nov-2021 07:56
We are using a modified version of this iRule: https://devcentral.f5.com/s/articles/google-analytics-script-injection-911
(See our iRule below) to inject a script into HTTP Responses. This iRule works fine for unchunked HTTP Response pages.
However we have some Response pages returned by the backend server that are chunked and this iRule fails. For those pages, logging shows
this Out of bounds error from the iRule:
Nov 1 10:48:39 xxxxxxx.jhuapl.edu err tmm[19381]: 01220001:3: TCL error: /Common/xxxCUI <HTTP_RESPONSE_DATA> - Out of bounds (line 1) invoked from within "HTTP::payload replace 0 $content_length [string map [list $search "[subst -nocommands -nobackslashes [ifile get cui]]</body>"] [HTTP::payload]]"
Any ideas on how to handle this issue / use case are appreciated.
BigIP version = 15.1.2.1
Thanks
-Steve M
Solved! Go to Solution.
09-Nov-2021
09:12
- last edited on
04-Jun-2023
19:16
by
JimmyPackets
Hello Steve.
Try to downgrade your HTTP connection in order to avoid "Transfer-Encoding: chunked"
when HTTP_REQUEST {
HTTP::header remove "Accept-Encoding"
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
Regards,
Dario.
09-Nov-2021
09:12
- last edited on
04-Jun-2023
19:16
by
JimmyPackets
Hello Steve.
Try to downgrade your HTTP connection in order to avoid "Transfer-Encoding: chunked"
when HTTP_REQUEST {
HTTP::header remove "Accept-Encoding"
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
Regards,
Dario.
12-Nov-2021 06:03
@Dario - Thanks very much for that suggestion. It worked for our use case. High-5 to you for that help!
-Steve
12-Nov-2021 22:50
Great to hear that your issue is solved now.
Please, don't forget to mark my answer as "the best" to help other people to find it.
Regards,
Dario.