Here's my iRule
when HTTP_REQUEST {
if { [string match "*gadget*" [HTTP::header Referer] ] } {
discard
}
}
and a request coming through while it was in place
172.20.2.106 - - [30/May/2008:00:14:13 -0500] "GET /blah.blah.com/blah.gif HTTP/1.1" 304 0 "x-gadget:///blah.htm" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)"
I apologize as the original post said User-Agent and it's Referer. There are other gadget requests out there I'm looking to block as well as x-gadget and thus the wildcards.
It's my first iRule so maybe I'm missing something obvious