Skip to content

Does Hookdeck change file contents in multipart/form-data payloads #92

Open
@leggetter

Description

@leggetter

See #91 as an example

After running the cURL command and receiving the payload in the Node.js app, the PDF differs and does not show the original contents.

To replicate

  1. Clone the branch
  2. Navigate to typescript/inbound
  3. Install dependencies npm i
  4. Run the app npm run dev
  5. Create a Hookdeck connection and copy the Source URL from the output:
curl --location 'https://api.hookdeck.com/2023-07-01/connections' \
-X PUT \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_PROJECT_API_KEY' \
--data '{
  "name": "binary-test-connection",
  "source": {
    "name": "binary-test"
  },
  "destination": {
    "name": "cli-binary-test",
    "cli_path": "/upload"
  }
}'
  1. Connect with the Hookdeck CLI hookdeck listen 3030 binary-test
  2. Upload the file:
curl --location 'YOUR_HOOKDECK_URL' \
--form 'pdf=@"example-files/test.pdf"'
  1. View the original file test.pdf - it has text contents. Look in /uploads for the uploaded PDF and view it. The text contents will be missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions