Using HTTP::payload replace to insert payload content

I have seen lots of threads about using HTTP::payload replace to substitute content in a server response. It can also be used to add content to the payload.

One requirement is that you add “response rechunk” to the http profile.

This example adds text to the payload sent to the client. It could easily be a variable.

profile http profile-http-test {

defaults from http

response rechunk

insert xforwarded for enable

}

when HTTP_RESPONSE {

Insert HTML comment to the top of the payload.

http::payload replace 0 0 “”

}

Done. I did not get the categories set in my initial attempt, so I am not sure where my original attempt ended up. It is there now.

Excellent, thanks much!

-Colin