Lemaire_Frédéri
Sep 15, 2023Altostratus
Is it possible to use the following Irule syntac with TCL in a policy ?
Hello,
I've setup some code in an Irule .
This concerns a code that will take the URI, within this uri, search for first directory in the path and put it tolower before sending it to the server.
set uri [HTTP::uri]
I've setup some code in an Irule .
This concerns a code that will take the URI, within this uri, search for first directory in the path and put it tolower before sending it to the server.
set uri [HTTP::uri]
set block [lindex [split $uri /] 1]
if { $block ne [string tolower $block]}
{
set block2 [string tolower $block]
HTTP::uri [string map [list $block $block2] $uri]
#log local0. "Rewrited part of the URI : $block2"
#log local0. "URI Send to Back-end application : https://[HTTP::host][HTTP::uri]"
}
Is it possible to put this code in a TCL within a policy rule ?
I need to replace the first directory of the URI (ie: "/APPLICATION/dir1/DIR2/index.html") to lowercase /application/dir1/DIR2/index.html ( the rest of the URI must stay intact, only /Application/ part must be set to lowercase.
Thanks in advance.
Regards
I need to replace the first directory of the URI (ie: "/APPLICATION/dir1/DIR2/index.html") to lowercase /application/dir1/DIR2/index.html ( the rest of the URI must stay intact, only /Application/ part must be set to lowercase.
Thanks in advance.
Regards
Frédéric