Learn about Redwood and be one of the first to join the conversation

Visit Redwood Community
invalid string escape mask at javascript — Cloud Customer Connect
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

Question
9
Views
0
Comments
edited Dec 6, 2020 12:03PM in Integration

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: [email protected] -> 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!