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.  Content Type Header Updated Automatically after Results Action

    Posted 02/26/24 12:25 PM

    Dears,

    We have a MPGW service where we decrypt and verify the input payload and forward the same to backend. We are using Datapower Actions to verify and decrypt. The Content Type header is being updated to binary/octet-stream from text/plain after the Results Action. There is no processing post JSON Web Decrypt.

    Please help me in fixing/idenitifying the reason why the Content-Type header is being automatically updated.

    When I checked in the probe. The header value was text/plain after the Decrypt Action. It is changed to binary/octet-stream after Results Action. There is no other action between Decrypt and Results Action



    ------------------------------
    R K
    ------------------------------


  • 2.  RE: Content Type Header Updated Automatically after Results Action

    Posted 02/27/24 03:23 AM
    Edited by Hermann Stamm-Wilbrandt 02/27/24 03:23 AM

    Hi,
    you are doing a transformation with the RESULT action, and that does more than changing content-type.
    Easiest way to keep the request content-type is to make last action in your rule use output context OUTPUT
    and remove the RESULT action.
    In case other actions would modify content-type, then you can always set content-type
    to value "var://service/original-content-type":
    https://www.ibm.com/docs/en/datapower-gateway/10.0.1?topic=variables-varserviceoriginal-content-type-servicevarsoriginalcontenttype



    ------------------------------
    Hermann Stamm-Wilbrandt
    Compiler Level 3 support, IBM DataPower Gateways
    IBM
    Boeblingen Germany
    ------------------------------



  • 3.  RE: Content Type Header Updated Automatically after Results Action

    Posted 02/27/24 10:48 AM

    Thanks Hermann, I have tried your suggestion. The content type is updated to binary/octet-stream Upon removing the Results Action and updating the Output context of JSON Web Decrypt Action to OUTPUT. 

    Is it a feature of JSON Web Decrypt Action to change to content Type in that way?



    ------------------------------
    R K
    ------------------------------



  • 4.  RE: Content Type Header Updated Automatically after Results Action

    Posted 02/27/24 11:15 AM

    You said earlier:
    > When I checked in the probe. The header value was text/plain after the Decrypt Action. I
    >
    So no, decrypt action does not do that.
    Please export your config and attach to a new support ticket to see what is going on.
    In the meantime you can use XSLT or GatewayScript to set content-type to "var://service/original-content-type".
    Here as well it is important that output context of that xform action is OUTPUT, with no RESULT action.



    ------------------------------
    Hermann Stamm-Wilbrandt
    Compiler Level 3 support, IBM DataPower Gateways
    IBM
    Boeblingen Germany
    ------------------------------



  • 5.  RE: Content Type Header Updated Automatically after Results Action

    Posted 02/27/24 10:23 AM

    Hi I'm not sure why that would change.

    Where is the results action going? If it is just sending to OUTPUT then an option would be to have the decrypt action write directly to OUTPUT and you can remove the results action.



    ------------------------------
    Matthias Siebler
    DataPower/APIC development
    ------------------------------



  • 6.  RE: Content Type Header Updated Automatically after Results Action

    Posted 02/28/24 01:06 PM

    Hi, I have tried removing the Results Action with no Luck. I am planning to raise a support ticket for this.



    ------------------------------
    R K
    ------------------------------