Skip to content

fix(proxy): treat image uploads as binary#6093

Merged
TBonnin merged 1 commit into
NangoHQ:masterfrom
LevSky22:fix/proxy-image-upload-binary-types
May 19, 2026
Merged

fix(proxy): treat image uploads as binary#6093
TBonnin merged 1 commit into
NangoHQ:masterfrom
LevSky22:fix/proxy-image-upload-binary-types

Conversation

@LevSky22

@LevSky22 LevSky22 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Describe the problem and your solution

Nango Proxy currently raw-parses image uploads only when the incoming request has Content-Type: image/png. Other image uploads such as image/jpeg are not matched by isBinaryContentType(), so the request can reach the proxied provider with an empty body.

This changes the binary content-type prefix from image/png to image/, preserving PNG support while covering common direct image uploads such as JPEG, WebP, and HEIC.

Issue ticket number and link

Fixes #6092.

Testing instructions

  • docker run --rm -v /home/fortuna/dev/nango-upstream:/repo -w /repo node:22-alpine npx vitest packages/server/lib/utils/utils.unit.test.ts --run
  • Real-path smoke test on a self-hosted Nango instance with this same runtime patch:
    • n8n -> Nango Proxy -> Xero demo
    • Created a demo Xero BankTransaction
    • Uploaded a JPEG attachment through Nango Proxy with Content-Type: image/jpeg
    • Xero returned attachment MimeType: image/jpg and ContentLength: 516
    • The demo BankTransaction was then updated to Status: DELETED

@superagent-security superagent-security Bot added contributor:verified Contributor passed trust analysis. pr:verified PR passed security analysis. labels May 9, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@hassan254-prog hassan254-prog requested a review from a team May 19, 2026 18:21
@TBonnin TBonnin force-pushed the fix/proxy-image-upload-binary-types branch from 30cbc7e to 33c2f79 Compare May 19, 2026 18:25
@superagent-security superagent-security Bot removed the pr:verified PR passed security analysis. label May 19, 2026
@TBonnin TBonnin enabled auto-merge May 19, 2026 18:26
@TBonnin TBonnin added this pull request to the merge queue May 19, 2026
Merged via the queue into NangoHQ:master with commit 55a61eb May 19, 2026
23 of 24 checks passed
sapnesh-nango pushed a commit that referenced this pull request May 24, 2026
## Describe the problem and your solution

Nango Proxy currently raw-parses image uploads only when the incoming
request has `Content-Type: image/png`. Other image uploads such as
`image/jpeg` are not matched by `isBinaryContentType()`, so the request
can reach the proxied provider with an empty body.

This changes the binary content-type prefix from `image/png` to
`image/`, preserving PNG support while covering common direct image
uploads such as JPEG, WebP, and HEIC.

## Issue ticket number and link

Fixes #6092.

## Testing instructions

- `docker run --rm -v /home/fortuna/dev/nango-upstream:/repo -w /repo
node:22-alpine npx vitest packages/server/lib/utils/utils.unit.test.ts
--run`
- Real-path smoke test on a self-hosted Nango instance with this same
runtime patch:
  - `n8n -> Nango Proxy -> Xero demo`
  - Created a demo Xero BankTransaction
- Uploaded a JPEG attachment through Nango Proxy with `Content-Type:
image/jpeg`
- Xero returned attachment `MimeType: image/jpg` and `ContentLength:
516`
  - The demo BankTransaction was then updated to `Status: DELETED`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:verified Contributor passed trust analysis.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proxy drops image/jpeg upload bodies because binary content-type allowlist only includes image/png

3 participants