Forum Discussion
Tony2020
Nimbostratus
May 25, 2017Better way to match different URI based on XFF and different data group with IP
Hi All, I was wondering if anyone can point out or suggest a better or more effcient way to put together the two logic together in this code. Data group: Data group with IP 1.1.1.1/32 & ...
JG
Cumulonimbus
May 25, 2017Try this modified one:
when HTTP_REQUEST {
foreach CHECK_IP [split [string map [list " " ""] [HTTP::header "X-Forwarded-For"]] ","] {
switch -glob [string tolower [HTTP::path]] {
"/externaluri" {
if { ! ([class match $CHECK_IP eq DG-XFF-EXTERNAL-ALLOWED-IP]) } {
reject
}
}
"/internaluri" {
if { ! ([class match $CHECK_IP eq DG-XFF-INTERNAL-ALLOWED-IP]) } {
reject
}
}
default {
}
}
}
}
.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
