Skip to content

Instantly share code, notes, and snippets.

@mittsh
Last active October 20, 2017 04:01
Show Gist options
  • Save mittsh/b69613c16e2421ae45b08cdeaab5b2ba to your computer and use it in GitHub Desktop.
Save mittsh/b69613c16e2421ae45b08cdeaab5b2ba to your computer and use it in GitHub Desktop.
function evaluate(context){
var stringToSign = '';
var request = context.getCurrentRequest();
var bodyKeys = request.getUrlEncodedBodyKeys().sort();
for (var i = 0; i < bodyKeys.length; i++) {
var key = bodyKeys[i];
if ('signature' !== key) {
stringToSign += key + "=" + request.getUrlEncodedBodyKey(key);
}
}
return stringToSign;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment