Just a quick rewrite:
when HTTP_REQUEST {
set xyz ""
HTTP::header insert "clientless-mode" 1
log local0. "clientless-mode 1"
set xyz [HTTP::query]
}
when ACCESS_POLICY_COMPLETED {
if { $xyz ne "" } {
log local0. "ACCESS_POLICY_COMPLETED: Found query string $xyz."
if {[ACCESS::policy result] equals "allow"} {
set abc ""
set abc [class match -value -- "$xyz" equals USERS_DG]
if { $abc ne "" } {
log local0. "ACCESS_POLICY_COMPLETED: $abc : access allowed"
ACCESS::respond 200 content $abc
event disable all
return
} else {
log local0. "ACCESS_POLICY_COMPLETED: param not matching acl: access not allowed"
ACCESS::respond 404 "resource not found."
event disable all
return
}
}
} else {
log local0. "ACCESS_POLICY_COMPLETED: query string not found."
ACCESS::respond 404 "resource not found."
event disable all
return
}
}