For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Godfrey_69235's avatar
Godfrey_69235
Icon for Nimbostratus rankNimbostratus
Sep 10, 2013

URL redirect looses POST data

What do i need to preserve post data in HTTP URI redirect?

Addition:

when HTTP_REQUEST { We would like to check if our https request is applicable for the requested page

                            if {[HTTP::uri] starts_with "/n/" } {

                HTTP::redirect "http://[HTTP::host][HTTP::uri]"

            } 

}

4 Replies

  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    Godfrey, a redirect will issue a http status 302 and a Get request to the new uri (rather than the original Post). Try HTTP:: respond using a 307 status code. This will maintain the original request type. Plenty of examples on DC. Hope this helps. N

     

  • JG's avatar
    JG
    Icon for Cumulonimbus rankCumulonimbus

    Many browsers will not behave the same way on receiving a 307. Depending on how badly you want this, it is possible to get your irule to parse the POST body, and return a 200 page that contains a new, pre-filled "form" that the user can re-submit to the new location.

     

  • Thank you Jie and Nathan. Just an addition. I am looking at performing SSL termination from F5. There are pages that are required to be in HTTPS and others HTTP. Whenever i apply HTTP to HTTPS redirect iRule and to the HTTP VS pool, it works fine, but if i request for a non-HTTPS page, it sticks with SSL (HTTPS)
  • if this is a new question just make a new question for it, now it becomes quite unclear if you are trying to combine things or not. if you are please post the full new irule.