Forum Discussion
Stanislas_Piro2
Jun 13, 2018Cumulonimbus
The problem when you anonymize the code is to check if the code you applied is correct!
if you convert URI or PATH (as suggested Jie) to lowercase, the switch condition must be lowercase.
for example :
when HTTP_REQUEST {
switch -glob [string tolower [HTTP_uri]] {
"/lion" { pool test1 member 1.1.1.1:8080 }
--> will match /lion /Lion /LION /LioN
"/Tiger" { pool test1 member 1.1.1.2:8080 }
--> will never match because you compare a lowercase string with a string with a uppercase character
"/mouse*" { pool test1 member 1.1.1.3:8080 }
--> will match /mouse /Mouse / /MOUSE /mousekdjghflh /MOuse/images/front.png
default { HTTP::redirect "/tiger" }
}
}