Forum Discussion
Jimmy20
Nimbostratus
Hello CJ,
Could you please explore more on below iRule :
when HTTP_REQUEST {
set app_pool [class match -value -- [string tolower [HTTP::uri]] starts_with services_redirect_class_8085]
if {$app_pool ne ""} {
pool $app_pool
} else {
return
}
}
As per your previous reply, I understand...that the rules are searching for a pool name based on URI OR within Data Group, If found (not equals empty), request are send to this pool name, otherwise return... (but return to where ...back to search criteria..?)
cjunior
Jun 23, 2020Nacreous
Hello,
The "return" command tells to exit/break from event HTTP_REQUEST. In your iRule the return looks disposable since it don't have code to escape after "return".
Example when return could be useful:
{
If { condition 1 matches } {
Do something here
} Else {
return
}
# This and lines below are reacheable only if condition 1 above is met
If { condition 2 matches } {
Do something here
}
Do something here
and on
}
Regards