Repository navigation
sell-api skill: proxy snippet drops decoded Content-Encoding, passes signal - #76
Merged
Merged
Conversation
…signal When the origin compresses despite Accept-Encoding: identity, Node's fetch decodes the body but keeps Content-Encoding and the compressed Content-Length; drop both (gzip, x-gzip, deflate, br), as proxyTo does. Pass req.signal so a client disconnect aborts the origin request. Plugin 0.1.2. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CoUQH199bauVsW6rSY3vw1
Contributor
|
kylecrawshaw
approved these changes
Oct 15, 2026
Contributor
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.
Requested by Eriks Reks · Slack thread
Before: The Node pass-through snippet in
sell-api/references/frameworks.md(merged in #72) asked the origin forAccept-Encoding: identity. If the origin compressed anyway, Node'sfetchdecoded the body but keptContent-Encoding: gzipand the compressedContent-Length. With an always-gzip origin, the client gotcontent-encoding: gzipandcontent-length: 33on a plain body, andcurl --compressedfailed with exit 61. The snippet also didn't pass the request'ssignal, so a client that disconnected left the origin request running. These are the same issues Kyle found inproxyToon #75.After: The snippet now treats a compressed response the same way
proxyToon #75 does. When every listed coding is gzip, x-gzip, deflate or br, it dropsContent-EncodingandContent-Length, and it passessignal: req.signal.How:
frameworks.md: the pass-through grows by 5 lines. It copies the origin headers once, checks the content codings, and passessignaltofetch.plugin.json0.1.1 → 0.1.2. The plugin CI requires a version bump.Checked by hand with the snippet from the file inside a minimal Hono app on
@hono/node-server, Node 22.22:curlContent-Encoding/Content-Lengthcurl --compressedcurl -m 1) on an origin that never answersThe snippet passes
tsc --strict.scripts/validate_plugin.py(with and without--base-ref origin/main) andclaude plugin validate plugins/radius --strictpass.Once
proxyTo(#75) is published, this block becomes a call to it.🤖 Generated with Claude Code
https://claude.ai/code/session_01CoUQH199bauVsW6rSY3vw1
Generated by Claude Code