Joss_100621
Jul 17, 2010Nimbostratus
modify original headers on HTTP:retry
Hi,
I have two HTTP server pools - webserver and authserver.
HTTP requests without a specific cookie ("authcookie") are redirected to authserver pool where they are authenticated.
If the request has passed the authentication the authserver will send auth cookie in the 200 response and set a specific header
LTM should intercept the 200 response, supress it so it is not sent back to the client and originate a new request to webserver pool copying the auth cookie to the original request from the client.
Below is a simplified form I have so far with a couple of questions inline:
when HTTP_REQUEST {
if { HTTP::cookie exists "userauth" }
{
pool webserver
LB::select
}
else {
set orig_request_headers [HTTP::request]
pool authserver
LB::select
}
}
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "200" and HTTP::header exists "userauth"}
{
set auth_cookie [HTTP::cookie "authcookie"]
pool vacc
LB::select
How to add auth_cookie to orig_request_headers?
How to supress original 200 coming from authserver and replace it with the 200 with content coming from webserver?
HTTP::retry $orig_request_headers
}
}