DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  On Error - override http response code and phrase

    Posted Tue April 27, 2021 02:08 AM

    Hi There,

    I am trying to override http response code and phrase on on-error rule but always getting

    HTTP/1.1 500 Error

    Content-Type: text/xml

    X-Backside-Transport: FAIL FAIL

    Connection: close

    what i have tried with:

    <dp:set-http-response-header name= "'x-dp-response-code'" value= "'200'" />

    <dp:freeze-headers/>

    as well as

    <dp:set-variable name="'var://service/error-protocol-response'" value="'200'"/>

    <dp:set-variable name="'var://service/error-protocol-reason-phrase'" value="'OK'"/>

    also have tried to enabling and disabling process backend Error

    all above doesn't work.

    Please advice.



    #DataPower
    #Support
    #SupportMigration


  • 2.  RE: On Error - override http response code and phrase

    Posted Tue April 27, 2021 04:47 AM

    Hi,

    please try the following:

    Go to XML Threat Protection Tab, scroll down to Padding Oracle Protection and

    set Rewrite Error Messages -> off

    --HP



    #DataPower
    #Support
    #SupportMigration


  • 3.  RE: On Error - override http response code and phrase

    Posted Tue April 27, 2021 05:10 AM

    Hi HP,

    marking Rewrite Error Message off doesn't work.


    Sanjeev



    #DataPower
    #Support
    #SupportMigration


  • 4.  RE: On Error - override http response code and phrase

    Posted Tue April 27, 2021 05:58 AM

    Is the on-error action on request or response rule? And what is the error mode?

    --HP



    #DataPower
    #Support
    #SupportMigration


  • 5.  RE: On Error - override http response code and phrase

    Posted Tue April 27, 2021 06:48 AM

    on-error action added on both request and response and have tried with Error mode cancel and alternative (Error rule with Direction Error)


    Also have tried without on-error on request and response but keeping Error rule (with direction Error)


    Sanjeev



    #DataPower
    #Support
    #SupportMigration


  • 6.  RE: On Error - override http response code and phrase

    Posted Wed April 28, 2021 06:54 AM

    Ok. If you are using error-mode cancel and the processing goes to the error rule then setting variables


    <dp:set-variable name="'var://service/error-protocol-response'" value="'200'"/>

    <dp:set-variable name="'var://service/error-protocol-reason-phrase'" value="'OK'"/>


    should work. Just tested and works like a charm, at least in firmware IDG.10.0.0.1. Are you sure that your error rule isn't somehow failing before you hit the action that sets the variables?


    --HP


    --HP



    #DataPower
    #Support
    #SupportMigration


  • 7.  RE: On Error - override http response code and phrase

    Posted Thu April 29, 2021 08:19 AM

    this is the missing bit that helped me to solve my problem

    https://www.ibm.com/support/pages/node/159589



    #DataPower
    #Support
    #SupportMigration