Bob_10976
Mar 26, 2012Nimbostratus
Blocking Specific User-Agent
Hello all,
I'm attempting to block any traffic that comes in with the User-Agent that contains github.com/tenderlove/mechanize. Using the fourms I came up with the below iRule, however I'm getting an error message when I check it. I'm not sure what I'm missing.
when HTTP_REQUEST {
if { HTTP::header "User-Agent" contains "github.com/tenderlove/mechanize"} {
reject
}
}
Error on check: line 2: [parse error: PARSE syntax 32 {syntax error in expression " HTTP::header "User-Agent" contains "github.com/tenderlove/m...": variable references require preceding $}] [{ HTTP::header "User-Agent" contains "github.com/tenderlove/mechanize"}]
Any thoughts on or suggetions?
Thanks,
Bob