Forum Discussion
chris_p_clark_1
Nimbostratus
Apr 13, 2017Set HTTP::header when ASM_REQUEST_DONE
I want to set a header within the ASM_REQUEST_DONE event. I have the logic to do what I need but it does not set the header. There are examples on this site of people doing it but it does not work for me, any thoughts. ASM 11.6.0
when ASM_REQUEST_DONE {
foreach {viol} [ASM::violation names] {
log local0. "Violation is $viol"
if {$viol eq "VIOLATION_HTTP_SANITY_CHECK_FAILED"} {
log local0. "Yep, found VIOLATION_HTTP"
HTTP::header insert "WAF VIOLATION_HTTP"
}
}
}
- cjunior
Nacreous
Hi, you could try something like this:
when ASM_REQUEST_DONE { if { [ASM::status] ne "clear" } { foreach {viol} [ASM::violation names] { log local0. "Violation is $viol" if {$viol eq "VIOLATION_HTTP_SANITY_CHECK_FAILED"} { log local0. "Yep, found VIOLATION_HTTP" set violation_http_found 1 } } } } when HTTP_RESPONSE_RELEASE { if { [info exists violation_http_found] } { HTTP::header insert WAF VIOLATION_HTTP unset violation_http_found } }
Regards.
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