Forum Discussion
Http Trace Deny
Hi, I'm trying to upgrade version 10 to 11 but there is an error pointing back to an irule that is causing an upgrade failure. I've then since taken the irule out but trying to paste it back but it returns me this error. Does anyone know what is causing this error?
Error:
01070151:3: Rule [/Common/HTTP_trace_deny] error: Unable to find value_list (sec_http_methods) referenced at line 12: [matchclass [HTTP::method] equals $::sec_http_methods]
iRule:
when RULE_INIT {
set sec_http_methods [list "CONNECT" "DELETE" "HEAD" "OPTIONS" "PUT" "TRACE"]
}
when HTTP_REQUEST {
if { [matchclass [HTTP::method] equals $::sec_http_methods] } {
reject
}
}
3 Replies
- Kevin_Stewart
Employee
You've set a non-CMP local variable in RULE_INIT and trying to access it like a global variable. Try this:when RULE_INIT { set static::sec_http_methods [list "CONNECT" "DELETE" "HEAD" "OPTIONS" "PUT" "TRACE"] } when HTTP_REQUEST { if { [lsearch $static::sec_http_methods [HTTP::method]] ne -1 } { reject } }
You're also evaluating a list element, so you should use a list function (lsearch). - TNY_122436
Nimbostratus
Thanks Kevin. Your code seems to work fine. The weird thing is we have another F5 guest on the same code version and the original irule seems to be working there.
- Kevin_Stewart
Employee
Same platforms?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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