Forum Discussion
hooleylist
Jan 07, 2010Cirrostratus
Hi Ken,
That's a good start. You could take the second example on the HTTP::collect wiki page (Click here and add a check to see that the response content type contains "text" (or other relevant content-types for you):
if {[HTTP::header "Content-Length"] contains "text" && \
[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
In HTTP_REQUEST_DATA, you could then insert the Google Javascript using:
HTTP::payload replace 0 0 $new_payload
The first digit is the offset. 0 starts the insertion at the beginning. The second digit is the length of the string to replace. 0 replaces nothing.
Aaron