DataPower

 View Only
  • 1.  header validation on mpgw service

    Posted Wed March 20, 2024 02:33 PM
    Hi Team,
    Please check the below example: 
    We have created MPGW for routing this specific backend URL, When we hit "GET abcuat.com we get 200 OK" When we attempt to send a request to a certain destination with a different host (such as fb.com or google.com) in the header, we only receive a "200 OK" response. However, we should receive a "404 Not Found" response, similar to what we get for other hosts like google.com or fb.com.

    Please check the image for reference and description:
    1) Google_host_404.png --> When we hit google.com with a different host we got 404 not found
    2) abcuat_200_issue.png --> When we abcuat.com with different host we got 200 OK

    Expectations: We should receive an error response if we include any host other than the specified one in the request header.
    As per your example: inbound Host:abcuat.com ---> uat-env MPWG --> http://10.*.*.**:####
    (uat-env MPWG--- From MPGW we should get an error)

     



    ------------------------------
    Akhil Salgotra
    ------------------------------


  • 2.  RE: header validation on mpgw service

    Posted Thu March 21, 2024 07:07 AM

    Hi Akhil; what kind of data does the mpgw expect to get?

    If it is variable; you should set the mpgw -> request-type to preprocessed (non-xml)



    ------------------------------
    Matthias Siebler
    MA
    ------------------------------



  • 3.  RE: header validation on mpgw service

    Posted Thu March 21, 2024 08:39 AM

    Hi Akhil,
    If I understand your question, is your MPGW at abcuat.com and you want it to return a 404 Not Found if the inbound Host request header is not abcuat.com?  If so that is validation you'll need to add to your MPGW's request rule, either with an XSLT or a GatewayScript action by getting the value of the Host header and comparing it to a value you expect it to be.  If they don't match, then set the response status code to 404 Not Found and reject the transaction.  Only if it passes would your MPGW respond with whatever response you expect with a 200 OK.
    Regards,
    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 4.  RE: header validation on mpgw service

    IBM Champion
    Posted Thu March 21, 2024 10:13 AM

    Is this some kind of outbound proxy?

    That is, it isn't clear based upon images from PostMan that you are hitting DataPower in any way.   Where is DataPower in this mix and what does google or facebook have to do with abcuat.com?



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