Forum Discussion
Peter_72728
Aug 11, 2011Nimbostratus
Are you trying to do this check based on the request URI? I see HTTP::uri in your switch, but some of the values in the switch cases don't look like valid URI patterns.
First, HTTP::uri always starts with a "/". Secondly, you have other folders in your example path (/app_themes/default/images/icon.check.png) before the "image" folder in your switch case. So I think you need to change some of them as follows...
when HTTP_REQUEST {
set debug 1
switch -glob [string tolower [HTTP::uri]] {
"text/*javascript" - this looks like a content type. Do you really have a URI pattern in the site that looks like this?
"*/scripts/*.js" - needs to have a leading wildcard
"text/*.css" - is this a content type, too? Or should it have a leading wildcard?
"*/images/*.swf" - needs to have a leading wildcard -- and the "s" in "images"
"*/images/*.gif" -
"*/images/*.png" -
"*/images/*.jpg" -
"*/images/*.jpeg"
...