IBM Support

IT34467: GATEWAYSCRIPT ERROR MIGHT OUTPUT NAN INSTEAD OF MULTIPLE PERCENT CHARACTERS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The user attempted to print a URL query params string escaped
    by "querystring.escape" to log using IBM DataPower
    GatewayScript "console.error" but hit unexpected "NaN" results
    after the second escaped character (here the ampersand).
    // good log: a%3D1
    console.error(´good log: ${querystring.escape('a=1')}´);
    // bad log: a%3D1 NaN%3D2
    console.error(´bad log: ${querystring.escape('a=1&b=2')}´);
    In contrast, writing the escaped string to a context variable
    or to output shows the escaping itself is fine.
    // good output: a%3D1%26b%3D2
    session.output.write (´good output:
    ${querystring.escape('a=1&b=2')}´);
    

Local fix

  • A workaround is to replace the percent character as '%%'.
    // replaced log: a%3D1%26b%3D2
    console.error(´replaced log:
    ${querystring.escape('a=1&b=2').replace(/%/g, '%%')}´);
    

Problem summary

  • GatewayScript querystring.escape fails for more than 2 URI
    params creating NaN
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    IT34467

  • Reported component name

    DATAPOWER

  • Reported component ID

    DP1234567

  • Reported release

    18X

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-10-07

  • Closed date

    2020-11-20

  • Last modified date

    2020-11-20

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DATAPOWER

  • Fixed component ID

    DP1234567

Applicable component levels

  • R18X PSY

       UP

  • RA0X PSY

       UP

[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SS9H2Y","label":"IBM DataPower Gateways"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"18X"}]

Document Information

Modified date:
28 September 2021