Forum Discussion
TMaCEvans_92750
Jan 17, 2011Nimbostratus
nesting switch within aif statement
I'm trying to nest a switch statement in a if statement but am getting a parse error
[parse error: PARSE syntax 302 syntax\ error\ in\ expression\ \"\ switch\ -glob\ \[string\ tolower\ \[HTTP::u...
TMaCEvans_92750
Jan 17, 2011Nimbostratus
sorry to clear up the nested if statement to start with
not all the traffic that goes to this application that uses websockets requires HTTP::disable thus the nested if
have added a few comments below
[codewhen HTTP_REQUEST {
check is for websocket server (if it is then check if it is websocket if so disable HTTP then pass to pool3 else leave alone and pass to pool3)
if { [URI::path [HTTP::path]] starts_with "/xyz/" || [HTTP::query] contains "xy=9" } {
check is web socket
if { [HTTP::method] equals "GET" && [HTTP::header exists "Upgrade"] && [HTTP::header Upgrade] contains "WebSocket" } {
disbale http for websocket traffic
HTTP::disable
}
send to pool3
pool pool3
check which country it is for and send to coresponding server
} elseif { switch -glob [string tolower [HTTP::uri]] {
"/fr/app*" { pool pool2 }
default { pool Pool1 }
}
} else {
if it doesnt meet any of that criteria send to pool1
pool pool1
}
}
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