Hi,
You may want to only enable the stream profile if the request is a POST with a content-length value greater than 0:
when HTTP_REQUEST {
Check if request is a POST and Content-Length header is > 0
if {[HTTP::method eq "POST" && \
[HTTP::header exists "Content-Length"] and [HTTP::header "Content-Length"] > 0}{
Set the stream find/replace
STREAM::expression "@https://10.104.30.55@http://10.104.30.55@"
Enable the stream filter for this request only
STREAM::enable
} else {
Disable the stream filter by default
STREAM::disable
}
}
when HTTP_RESPONSE
Disable the stream filter for the response
STREAM::disable
}
Make sure you add a blank stream profile to the virtual server and create a custom HTTP profile with response chunking set to rechunk. I think you may also want to disable the stream filter for the response so it's not applied to the response payload.
You can check the STREAM::expression wiki page (
Click here) for details on the command.
You could also add code to log the match in the STREAM_MATCHED event (
Click here) when debugging the iRule.
Aaron