DataPower

 View Only
  • 1.  MPGW : Responding with http 302 fails

    Posted Tue February 01, 2022 09:38 AM
    Edited by Sunil Hunashikatti Wed February 02, 2022 03:45 AM
    Hi Experts,

    I have a simple pass through mpgw where datapower forwards the HTTP POST with content-type : application/x-www-form-urlencoded request to backend.
    Backend responds with HTTP 302 and location header with value being http url to some static html web page.
    HTTP Redirects is switched off on mpgw

    I'm getting error in handling http 302 responses : 

    Errors :
    "Backside header failed to parse due to:
    Failed to establish a backside connection"
    and RFC 2616 sec 10.3

    I tried to search IBM blogs and landed at  https://www.ibm.com/support/pages/handling-302-redirect-error-message

    I did follow the approach mentioned in above blog but still i am not able to see the response from datapower as - HTTP 302 with location header to clients.

    Can anyone please assist. Thank you!


    ------------------------------
    Many Thanks,
    Sunil
    ------------------------------


  • 2.  RE: MPGW : Responding with http 302 fails

    IBM Champion
    Posted Wed February 02, 2022 06:33 AM
    Hi Sunil,

    Do you have "Follow redirects"on or off in your MPGW? The setting can be found from "Advanced" tab.

    ------------------------------
    Hermanni Pernaa
    ------------------------------



  • 3.  RE: MPGW : Responding with http 302 fails

    Posted Wed February 02, 2022 09:22 AM
    Edited by Sunil Hunashikatti Wed February 02, 2022 09:23 AM
    It is off - mentioned in my initial post "HTTP Redirects is switched off on mpgw"

    I solved it myself - i had configured policy rule wrong.
    Thank you for your time.

    ------------------------------
    Sunil
    ------------------------------



  • 4.  RE: MPGW : Responding with http 302 fails

    Posted Wed February 02, 2022 06:57 AM
    Hi yes per the rfc we do not follow redirects for a POST;
     
    the customer would have to send the 302 back to the client 







  • 5.  RE: MPGW : Responding with http 302 fails

    Posted Wed February 02, 2022 09:23 AM
    Edited by Sunil Hunashikatti Wed February 02, 2022 09:23 AM
    Yes. It was my mistake - I had configured the policy rule wrong.
    It works now.
    Thank you for your time.

    ------------------------------
    Sunil
    ------------------------------



  • 6.  RE: MPGW : Responding with http 302 fails

    Posted Mon June 05, 2023 11:30 AM

    Hi @Sunil Hunashikatti 
    I have the same problem; same symptom. Im not sure if DP is making a call to its self with the redirect at some point; although I see the redirect uri on the test html page im using to instigate the original message.
    What did you need to change to make it work?



    ------------------------------
    Alan Broadbent
    ------------------------------



  • 7.  RE: MPGW : Responding with http 302 fails

    Posted Mon June 05, 2023 11:30 AM

    I need to say that the redirect response from the server is to perform a GET. Ive coded passthru settings and the client html page receives from the browser the correct full redirect url, but it cannot complete and has error 500, until you perform a refresh then the host responds with an error page as expected.

    The probe show Request rule as normal, but then only an error rule call, where the in and out url are both Datapower ip and port, but with the new redirected uri



    ------------------------------
    Alan Broadbent
    ------------------------------



  • 8.  RE: MPGW : Responding with http 302 fails

    IBM Champion
    Posted Mon June 05, 2023 11:47 AM

    Can you see the Location header in the probe from the response?

    What other errors are you getting, especially asking if the log error is about RFC 2616 sec 10.3 and the non-idempotent request.



    ------------------------------
    Joseph Morgan
    ------------------------------