Hi
I’m trying to implemet ICAP based on file types. Only certain file types allowed to be forwarded to ICAP server.
I tried to implemet this iRule:
when HTTP_REQUEST {
if {([HTTP::method] eq "POST")} {
set path [HTTP::path]
switch -glob $path {
"*.doc" -
"*.pdf" -
"*.docx" -
"*.xlx" -
"*.xlsx" {
log local0. "Requested uri: [HTTP::uri] from IP: [IP::local_addr] forwarded to ICAP"
ADAPT::enable request enable
}
"*.html" -
"*.js" {
log local0. "Requested uri: [HTTP::uri] from IP: [IP::local_addr] no need for ICAP"
ADAPT::enable request disable
}
default {
log local0. "Requested uri: [HTTP::uri] from IP: [IP::local_addr] redirected to blockpage"
HTTP::redirect http://blabla.com/virus.html
}
}
}
}
But the thing is that the http path does not end with *.doc or any other file type in the irule.
What is the http header to check that contains the ?
Thanks!