Forum Discussion

2funky_105078's avatar
Oct 08, 2013

How to preserve data in a HTTP 302 redirect of a POST

Hi,

 

We are trying to implement the following scenario and would like to know if the LTM can do the following:

 

  1. An application execute an HTTP POST request with parameters inside the HTML body
  2. LTM sends back a 302 redirect request back to the client to another local url

How can LTM sends back in the 302 redirect with the same parameters that were availble in the initial packet (see 1))?

 

Can LTM look into HTML body and use them in packet 2) with an iRule?

 

In initial packet 1) these parameters can be a small text or a large file that is being posted to the servers behind LTM

 

Thanks, Giulio.

 

  • Hello, I am facing similar challenge. I insert a new value to request header before redirect. seems that F5 drops the new value somehow.

     

    HTTP::header insert "appKey" "$app_key" HTTP::redirect "https://$NewHost[HTTP::uri]"

     

    if I log header into logs, I can see that appKey gets inserted. however when I check at NewHost, I see the request came in with no appKey value in the header.

     

    in other cases when I had to do the same, it worked but there was no redirect. so I am certain that redirect has something to do with it. it's just wont let through any newly added name/value in request-header.

     

    any idea how can I insert new name/value into request header and make redirect call right after ( without losing new added value).?

     

    thank you in advance.

     

  • Jaz, use HTTP::respond instead.

    HTTP::respond 302 Location "https://$NewHost[HTTP::uri]" "appKey" "$app_key"
    

    This command allows you to insert an arbitrary set of headers (most important the "Location" header).