Forum Discussion
EddieJK_26590
Nimbostratus
May 01, 2017How do you block empty user-agents?
Hi,
I want to create an iRule to block empty user-agents from hitting our web site instead of letting IIS do it. I've read several posts and came up with this one. Is this ok?
...
David__Pasch
Altostratus
May 02, 2017I was not able to test these, but either should get you the results you are looking for:
when HTTP_REQUEST {
if {[class match [HTTP::header "User-Agent"] equals ""]} {
reject
}}
OR
when HTTP_REQUEST {
if { [HTTP::header exists User-Agent]} { if { [HTTP::header User-Agent] equals "" } {
reject
}}}
Good Luck!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects