feat: add @transloadit/notify-url-relay package#356
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2ebe480cf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for (const [name, value] of upstreamResponse.headers) { | ||
| const headerName = name.toLowerCase() | ||
| if (HOP_BY_HOP_HEADERS.has(headerName) || headerName === 'set-cookie') { | ||
| continue | ||
| } | ||
| response.setHeader(name, value) |
There was a problem hiding this comment.
Drop encoding headers when forwarding decompressed fetch body
In pipeForwardResponse, this loop copies upstream response headers verbatim before streaming upstreamResponse.body, but Node's fetch transparently decodes gzip/br while still exposing original content-encoding and compressed content-length. Forwarding those headers with a decoded body causes downstream clients to mis-decode or abort (for example, gzip decode failures/terminated responses) whenever the target returns compressed payloads, which can break normal proxy traffic to compression-enabled endpoints.
Useful? React with 👍 / 👎.
Summary
@transloadit/notify-url-relayworkspace package underpackages/notify-url-relaynotify-url-proxytonotify-url-relaycontent-encoding/content-lengthheadersaccept-encoding: identityto reduce decompression/header mismatcheslint:ts,test:unit) and add a dedicated knip workspace configValidation
corepack yarn checkcorepack yarn workspace @transloadit/notify-url-relay test:unitcorepack yarn workspace @transloadit/notify-url-relay test:real(skips locally without secrets)