HTTP:disable_event(code)
Disables an event based on the code specified via the parameter.
Syntax
HTTP:disable_event(code)
Arguments
|
Parameter |
Description |
|---|---|
| code |
A Lua integer in hex format to indicate the event.
|
Events
-
HTTP_REQUEST
-
HTTP_RESPONSE
-
HTTP_DATA_REQUEST
-
HTTP_DATA_RESPONSE
-
BEFORE_AUTH
-
WAF_REQUEST_BEFORE_SCAN
-
WAF_RESPONSE_BEFORE_SCAN
-
WAF_REQUEST_ATTACK_DETECTED
-
WAF_RESPONSE_ATTACK_DETECTED
Example
In this example, code 0x1000 means BEFORE_CONNECT event, once that is disabled, the corresponding event function will not be called anymore.
when HTTP_REQUEST {
HTTP:disable_event(0x1000)
}
when SERVER_BEFORE_CONNECT {
--This will not be called.
debug("------> Events: SERVER_BEFORE_CONNECT begin:[%s]\n", ctime())
cip = IP:client_addr()
debug("------> client IP %s\n", cip)
debug("------> Events: SERVER_BEFORE_CONNECT end:[%s]\n", ctime())
}
Supported Version
FortiADC version 5.0.x and later.