Forum Discussion
Torti
Cirrus
Jan 07, 2014tcl error, when modifying http response
Hi guys,
We need a custom response for a dedicated validation (XML violation).
For this case I did expand the irule with the following lines:
when ASM_REQUEST_BLOCKING {
set x [...
uni
Altocumulus
Jan 07, 2014It looks to me like it is saying that the HTTP::header command is not allowed within the ASM_REQUEST_BLOCKING event. Kind of strange, given that the example on the ASM_REQUEST_BLOCKING page does just this.
Perhaps enclose some of the code in try/catch, and do some extra logging of the payload when it fails.
- uniJan 07, 2014
Altocumulus
Unrelated, but you should use 'contains' not '==' to test for the violation, as [lindex $x 0] is a comma separated list of violations - TortiJan 08, 2014
Cirrus
The problem is, that I cannot reproduce the error. I did add some extra log and changed to 'contains'. The 'contains' is a little bit strange, because in the wiki is the violation filed described as String. And I did never see a comma seperated list in the log, here. But it really looks like the system has some trouble with the HTTP::header command within the ASM_REQUEST_BLOCKING event. I tried "if { [HTTP::header exists Content-Length] } {}" before removing the header, but then I SOMETIMES get the TCL error: Illegal argument. Can't execute in the current context. (line 1) invoked from within "HTTP::header exists Content-Length"
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