HTTP::has_responded

Description

This iRules command returns true if this HTTP transaction has been prematurely completed by an iRule command or other filter logic. This can be triggered by HTTP::respond, HTTP::redirect, HTTP::retry, and some ACCESS commands.

Syntax

HTTP::has_responded

Examples

when HTTP_REQUEST {
  # Used for cases where only one response to the client is permitted.
  # Another HTTP::respond might have been called in other iRULE script.
  if {[HTTP::has_responded]} {
    log local0. "Have already responded."
  } else {
    HTTP::respond 200 content {<html><body>First and Only Response</body></html>}
  }
}