Forum Discussion
Olivier_Van_der
Nimbostratus
Sep 25, 2006CodeShare - Phising preventation
I am just starting to learn iRules and I am examining the CodeShare examples to learn from best practices.
Looking at the Phising Prevention iRule, I think that some optimization is possible. The iRule can be evated using capital characters in filename extensions
This is the code in line 32:
if { ([string tolower [HTTP::method] ] eq "get") && ([matchclass [HTTP::uri] contains $::file_types] > 0 )} {
I would suggest the line below is better.
if { ([string tolower [HTTP::method] ] eq "get") && ([matchclass [string tolower[HTTP::uri]] contains $::file_types] > 0 )} {
The only uncertainty is that I assumed that matchclass is case sensitive.
Im I right on this or did I miss something?
For reference: the class file_types that is referred to is defined as below:
class file_types {
".gif"
".jpg"
".png"
".bmp"
".js"
".css"
".xsl"
}
- unRuleY_95363Historic F5 AccountYup, you're right. Good eye!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects