Skip to content

sell-api skill: proxy snippet drops decoded Content-Encoding, passes signal - #76

Merged
erikzrekz merged 1 commit into
mainfrom
claude/sell-api-proxy-snippet-fixes
Oct 15, 2026
Merged

erikzrekz merged 1 commit into
mainfrom
claude/sell-api-proxy-snippet-fixes

Conversation

@claude

@claude claude Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Requested by Eriks Reks · Slack thread

Before: The Node pass-through snippet in sell-api/references/frameworks.md (merged in #72) asked the origin for Accept-Encoding: identity. If the origin compressed anyway, Node's fetch decoded the body but kept Content-Encoding: gzip and the compressed Content-Length. With an always-gzip origin, the client got content-encoding: gzip and content-length: 33 on a plain body, and curl --compressed failed with exit 61. The snippet also didn't pass the request's signal, so a client that disconnected left the origin request running. These are the same issues Kyle found in proxyTo on #75.

After: The snippet now treats a compressed response the same way proxyTo on #75 does. When every listed coding is gzip, x-gzip, deflate or br, it drops Content-Encoding and Content-Length, and it passes signal: req.signal.

How:

  • frameworks.md: the pass-through grows by 5 lines. It copies the origin headers once, checks the content codings, and passes signal to fetch.

  • plugin.json 0.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:

    Check Old snippet New snippet
    Always-gzip origin, curl gzip headers on a plain body 200, no Content-Encoding/Content-Length
    Always-gzip origin, curl --compressed exit 61 exit 0, body intact
    Client times out (curl -m 1) on an origin that never answers origin never saw the connection close origin saw the connection close
  • The snippet passes tsc --strict. scripts/validate_plugin.py (with and without --base-ref origin/main) and claude plugin validate plugins/radius --strict pass.

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

…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
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ No Changeset found

Latest commit: a5b6388

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

@erikzrekz
erikzrekz merged commit 17883bb into main Oct 15, 2026
8 checks passed
@erikzrekz
erikzrekz deleted the claude/sell-api-proxy-snippet-fixes branch October 15, 2026 17:58
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

Successfully merging this pull request may close these issues.

3 participants