Forum Discussion
Ajmal_2608
Nimbostratus
Feb 02, 2013Getting errors while upgrading from 10.x to 11.x
Issue:
We were getting errors with the existing configuration, after migrating to 11.2.1 some syntax errors, probably in the irules. The one I noticed is the keyword "na1esbapppool".
...
Ajmal_2608
Nimbostratus
Feb 02, 2013Looks like the $:: was creating a problem
https://devcentral.f5.com/wiki/iRules.class.ashx
However I still have a question:
Existing Code snippet of iRule
------------------------------------------
when RULE_INIT {
set safe_http_methods [list "GET" "PUT" "DELETE" "POST" "HEAD" "OPTIONS"]
}
when HTTP_REQUEST {
if { ![matchclass [HTTP::method] equals $::safe_http_methods] } {
set trafficLog "$trafficLog REJECTED:badMethod"
HTTP::respond 302 noserver Location "https://[HTTP::host]/error/error.html"
}
}
Modified for 11.x
----------------------------
when RULE_INIT {
set safe_http_methods [list "GET" "PUT" "DELETE" "POST" "HEAD" "OPTIONS"]
}
when HTTP_REQUEST {
if { ![class match -- [HTTP::method] equals $safe_http_methods] } {
set trafficLog "$trafficLog REJECTED:badMethod"
HTTP::respond 302 noserver Location "https://[HTTP::host]/error/error.html"
}
}
Will this work in 11.x as it is working fine in 10.2 ?
Also can I change the variable "safe_http_methods" to a "Data-Group" of some type like a "list" or "array" (if that is available in LTM) and use the same code? i.e.
if { ![class match -- [HTTP::method] equals $safe_http_methods] } {
set trafficLog "$trafficLog REJECTED:badMethod"
HTTP::respond 302 noserver Location "https://[HTTP::host]/error/error.html"
}
Please suggest
-Ajmal
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