cancel
Showing results for 
Search instead for 
Did you mean: 
hooleylist
Cirrostratus
Cirrostratus

Problem this snippet solves:

This rule intercepts the application response and sends an HTTP redirect to the client with any cookies the application set in its response.

Code :

when HTTP_RESPONSE {

   # Check if the response matches our criteria
   if {$some_condition == 1}{

      log local0. "[IP::client_addr]:[TCP::client_port]: Matched the response check."

      if { [HTTP::header exists Set-Cookie] }{
         HTTP::respond 302 Location "http://example.com" Set-Cookie [join [HTTP::header values Set-Cookie] "; "]
      } else {
         HTTP::respond 302 Location "http://example.com"
      }
   }
}
Version history
Last update:
‎18-Mar-2015 11:58
Updated by:
Contributors