Skip to content

Error when using apiPost with multipart in v5.0.1: "Signature hash does not match" #49

@hendaniel

Description

@hendaniel

Description

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

  1. Set up a Node.js environment with version 18.16.1.
  2. Use sailthru-client version 5.0.1.
  3. Implement a POST request using the apiPost function with multipart/form-data.
  4. 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.

Environment

  • OS: macOS
  • Node.js version: 18.16.1
  • Relevant libraries/frameworks:
    • sailthru-client version 5.0.1 (error occurs)
    • sailthru-client version 5.0.0 (no error)
  • Payload:
      const config = {
        job: 'update',
        report_email: 'email',
        file: './file.csv',
      }
      const multipart_params = ['file'] 
      apiPost('job', config, multipart_params)


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions