Forum Discussion
Bypassing ASM on HTTP response
- Aug 13, 2021
Try with an iRule. use appropriate asm policy name.
Use logging to see if condition is getting triggered and then it can be disabled.
when HTTP_RESPONSE { ASM::enable "/common/asm_policy" if { ([HTTP::status] == 500) and ([HTTP::header value Content-Type] eq "application/problem-handled-return-to-client") }{ log local0.info "disable asm" ASM::disable return } }
Something isn't working as expected. I use this simple code which I cut and pasted from https://clouddocs.f5.com/api/irules/HTTP_RESPONSE.html and made only a small change inside the IF-statement :
when HTTP_RESPONSE {
if { [HTTP::status] contains "500"} {
log local0.debug "HTTP_RESPONSE - err: 500"
}
}
But when I make a request that triggers a 500 status code then I get this message in the LTM log:
<date removed> <host removed> err tmm[14816]: 01220001:3: TCL error: /Common/asm-override <HTTP_RESPONSE> - Can't call after responding - ERR_NOT_SUPPORTED (line 1) invoked from within "HTTP::status"
We are using v15.1.2.1 with an Eng Hotfix.
Can't call after responding means most probably an event overlap is occurring. Checkout if there is another rule or policy attached to VS with HTTP_RESPONSE event.
If so, combine both HTTP_RESPONSE event content in one iRule.
Hope this helps
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