Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
leggetter opened this issue Jan 17, 2025 · 1 comment
Open

Comments

@leggetter
Copy link
Collaborator

leggetter commented Jan 17, 2025

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.
@jamesrusso
Copy link

@leggetter thanks for raising this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants