Forum Discussion
F5-Geek
Nimbostratus
Feb 20, 2018Irule not working
Below is my irule is not working if the URI::query doesn't have the required parameters.
Basically i want send respond 200 for successful connection and 401 for incorrect parameter or non parameter
P...
JG
Cumulonimbus
Feb 21, 2018Just 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
}
}
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