Kyle_S
Apr 20, 2015Nimbostratus
String tolower within a switch -glob
We are routing traffic to various Pools by their URI. Our developers are implementing a change to the name of the of the incoming URI and need it to point to the existing Virtual Directory on the server. It works using a string map but it has to be the correct case. I have a string tolower with the switch -glob but it doesn't carry over when it matches on the string map. Is there a way to have both of the functions string tolower?
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/vd/service/*" {
HTTP::uri [string map {"/VD/service/" "/change1/"} [HTTP::uri]]
pool Pool_service}
"/vd/forms/*" {
HTTP::uri [string map {"/VD/Forms/" "/change2/"} [HTTP::uri]]
pool Pool_forms}
"/vd/orders/*" {
HTTP::uri [string map {"/VD/Orders/" "/change3/"} [HTTP::uri]]
pool Pool_orders}
"/vd/contact/*" {
HTTP::uri [string map {"/VD/Contact/" "/change4/"} [HTTP::uri]]
pool Pool_contact}
default {
discard
}
}
}