fix(proxy): treat image uploads as binary#6093
Merged
TBonnin merged 1 commit intoMay 19, 2026
Merged
Conversation
hassan254-prog
approved these changes
May 19, 2026
30cbc7e to
33c2f79
Compare
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asimage/jpegare not matched byisBinaryContentType(), so the request can reach the proxied provider with an empty body.This changes the binary content-type prefix from
image/pngtoimage/, 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 --runn8n -> Nango Proxy -> Xero demoContent-Type: image/jpegMimeType: image/jpgandContentLength: 516Status: DELETED