Forum Discussion
Michael_Yates
Sep 19, 2011Nimbostratus
I would suggest using a Switch Statement rather than nested If Statements for efficiency and inside of your default behavior put a logging statement that you can enable periodically to see what other types of browsers are hitting your Virtual Server (or if you want to identify one to add it to your switch statement). When not in use you can disable it.
when HTTP_REQUEST {
switch -glob [HTTP::header User-Agent] {
"*MSIE*" { do something }
"*Firefox*" { do something }
"*Chrome*" { do something }
default {
log local0. "Unhandled User Agent: [HTTP::header User-Agent]"
}
}
}