cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use HTTP::Respond commmand in ADAPT_REQUEST_RESULT event?

Srinath_K_S
Altostratus
Altostratus

Can we use HTTP::Respond command in ADAPT_REQUEST_RESULT event?.

3 REPLIES 3

Simon_Blakely
F5 Employee
F5 Employee

No - HTTP::Respond is invalid in that context.

 

What is the problem you are trying to solve?

 

 

Srinath_K_S
Altostratus
Altostratus

Thanks for your reply.This is for an virus scanning solution, where in irule based on the scan status code response from ICAP server we perform different actions. For an error code we are trying to respond with a sorry page using HTTP::respond 302.

 

Please suggest if there is any alternative.

In HTTP_RESPONSE_RELEASE you can examine the HTTP::status and change the response with an HTTP::respond

when HTTP_RESPONSE_RELEASE { if {[HTTP::status] == 307} { HTTP::respond 403 content "<HTML><HEAD><TITLE>Access Denied</TITLE></HEAD><BODY>VIRUS FOUND.</BODY>\n } }

This irule changes the ICAP server response from a 307 Temporary Redirect to a 403 static error page.