You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to make a POST request using the apiPost function with multipart/form-data in Node.js 18.16.1 and using sailthru-client version 5.0.1, I encounter a signature hash mismatch error. The error message returned is {"error":5,"errormsg":"Signature hash does not match"}. This issue does not occur when using sailthru-client version 5.0.0.
Steps to Reproduce
Set up a Node.js environment with version 18.16.1.
Use sailthru-client version 5.0.1.
Implement a POST request using the apiPost function with multipart/form-data.
Execute the request.
Expected Behavior
The API should successfully process the multipart POST request without returning a signature hash mismatch error.
Actual Behavior
The API call fails and returns the following error message: {"error":5,"errormsg":"Signature hash does not match"}. The error does not occur when downgrading to sailthru-client version 5.0.0.
This appears to cause both variables to point to the same spot in memory, which means that when the following for/in loop runs immediately afterward....
for (param in binary_data) {
value = binary_data[param];
json_payload[param] = value;
json_payload_to_log[param] = '[TRUNCATED]';
}
... the payload's file data is simply changed to a string value of '[TRUNCATED]' rather than the actual file object which needs to be passed. The signature hash itself is valid, but the invalid file format is throwing this error on the Sailthru backend for whatever reason. Changing the above variable definition to json_payload_to_log = this._json_payload(data) appears to completely remedy this issue.
Thanks for looking into this! I'll be on the lookout for the fix release. We are also dealing with the JavaScript memory issue that was addressed in v5.0.1, so any updates would be greatly appreciated.
Description
When attempting to make a POST request using the
apiPost
function with multipart/form-data in Node.js 18.16.1 and usingsailthru-client
version 5.0.1, I encounter a signature hash mismatch error. The error message returned is{"error":5,"errormsg":"Signature hash does not match"}
. This issue does not occur when usingsailthru-client
version 5.0.0.Steps to Reproduce
sailthru-client
version 5.0.1.apiPost
function with multipart/form-data.Expected Behavior
The API should successfully process the multipart POST request without returning a signature hash mismatch error.
Actual Behavior
The API call fails and returns the following error message:
{"error":5,"errormsg":"Signature hash does not match"}
. The error does not occur when downgrading tosailthru-client
version 5.0.0.Environment
sailthru-client
version 5.0.1 (error occurs)sailthru-client
version 5.0.0 (no error)The text was updated successfully, but these errors were encountered: