Torti
Jan 07, 2014Altostratus
tcl 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 [ASM::violation_data]
log local0. "blocked XML request with violation: [lindex $x 0]"
if { [lindex $x 0] == "VIOLATION_XML_WSDL" } {
HTTP::header remove Content-Length
set response "mycustom response..."
ASM::payload replace 0 [ASM::payload length] ""
ASM::payload replace 0 0 $response
}
}
If I test this, everything is ok, but sometimes I can see the following line in the log:
TCL error: /Common/ContManIrule - Illegal argument. Can't execute in the current context. (line 4) invoked from within "HTTP::header remove Content-Length" invoked from within "if { [lindex $x 0] == "VIOLATION_XML_WSDL" } { HTTP::header remove Content-Length set response "..."
The log entry return: "Rule /Common/ContManIrule : blocked XML request with violation: VIOLATION_XML_WSDL"
Has anyone an idea whats wrong?
Thx