10-Feb-2009 13:35
10-Feb-2009 14:09
10-Feb-2009
19:44
- last edited on
22-Nov-2022
16:06
by
JimmyPackets
when HTTP_REQUEST {
Don't allow data to be chunked
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
Just add a Data Group list of type Address that includes the IP addresses & networks for which chunking is not desired, and modify the above code snip to add a source IP test against the address class:
when HTTP_REQUEST {
if {[matchclass [IP::client_addr] equals $::NoChunkIPs]}{
Don't allow data to be chunked
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
}
hth
/d
10-Feb-2009
19:51
- last edited on
01-Jun-2023
08:34
by
JimmyPackets
this s/b more efficient & does the same thing:
when CLIENT_ACCEPTED {
set chunk 1
if {[matchclass [IP::client_addr] equals $::NoChunkIPs]}{
set chunk 0
}
}
when HTTP_REQUEST {
if { $chunk == 0 }{
Don't allow data to be chunked
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
}
/d
07-Nov-2022 08:49
^ Expanding the above iRule as it was clobbered during one of our platform migrations
when CLIENT_ACCEPTED priority 500 {
set chunk 1
if {[class match -- [IP::client_addr] equals "/Common/NoChunkIPs"]} {
set chunk 0
}
}
when HTTP_REQUEST priority 500 {
if {$chunk == 0} {
# Don't allow data to be chunked
if {[HTTP::version] eq "1.1"} {
if {[HTTP::header is_keepalive]} {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
}