Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

invalid string escape mask at javascript

edited Dec 6, 2020 12:03PM in Integration 1 comment

Summary

invalid string escape mask at javascript

Content

HI,

I have the following file name (FR-EXP26621341d'Auzac de Lamartinie120120208038504.pdf )

I am using the below function to encode and escaping the characters to calculate the signature.

function sampleFun(filename) {

  var encodedRes = encodeURI(filename).replace(/['()]/g, escape).replace(/\*/g, '%2A').replace(/%(?:7C|60|5E)/g, unescape);
    return encodedRes
}

but I am getting below Error 

 "o:errorPath" : "Review JavaScript error(s) and fix them:\nerror: null@30 -> invalid string escape mask\n at: function=createAuthHeader, loc=js/AWSSIGNATURECALCULATION_01.00.0000/awssignature.js, line=30\n",
"o:errorCode" : "JavaScript execution error"
 
but the same function working in Browser.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!