Skip to content

fix(server): strip Expect and hop-by-hop headers from engine proxies - #6476

Open
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/server-proxy-strip-expect-header
Open

sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/server-proxy-strip-expect-header

Conversation

@sentry

@sentry sentry Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

What is this about?

A crash in the OpenCode proxy in apps/server when a client sends a POST with Expect: 100-continue.

What problem does it solve?

These requests failed with a 500 error. Node's built-in fetch (backed by undici) rejects the Expect header and throws NotSupportedError: expect header not supported, which surfaces as TypeError: fetch failed.

What was the situation before?

The proxy forwarded the incoming Expect header straight to the engine through fetch. HTTP/1.1 clients sending Expect: 100-continue got an unhandled 500.

How is this implemented?

  • A forwardableProxyRequestHeaders helper strips expect, the connection and hop-by-hop headers (connection, keep-alive, proxy-connection, upgrade, te, trailer), and the transport headers (host, origin, transfer-encoding) before forwarding to the engine.
  • The helper is applied to the v1 proxy (/workspace/:id/opencode/*) and the v2 proxy (/opencode2/*).
  • Unit tests in apps/server/test/proxy-request-headers.test.ts verify that disallowed headers are stripped and that the remaining headers are forwarded safely.

What else changed?

none

Release note

Requests with Expect: 100-continue sent through the OpenCode proxy no longer fail with a 500 error.

Fixes DESKTOP-APP-59

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry at no cost. You can adjust this setting at any time.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Oct 24, 2026 11:07pm UTC
openwork-den Skipped Skipped Oct 24, 2026 11:07pm UTC
openwork-diagnostics Skipped Skipped Oct 24, 2026 11:07pm UTC
openwork-landing Skipped Skipped v0 Oct 24, 2026 11:07pm UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – openwork-den October 24, 2026 23:07 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics October 24, 2026 23:07 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing October 24, 2026 23:07 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-app October 24, 2026 23:07 Inactive
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

OpenWork evidence

Status Commit Preview Updated
🟡 Updating evidence 6138034 View run 2026-10-24 23:07:57 UTC

A preview for this commit is being prepared.

@diff-warden diff-warden 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.

Warden clearance. Complete security and confidentiality review of 61380344d19543496fa5aae6b84eb8f23dea4117 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

@diff-warden

diff-warden Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Warden: approved

No high or medium security findings and no confidentiality findings.

Reviewed 61380344d195 · Warden run · Updates after every Warden run.

This branch is waiting to be deployed

4 inactive and 1 waiting deployments
Preview – openwork-den — 61380344 Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-diagnostics — 61380344 Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-landing — 61380344 Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-app — 61380344 Deployed Oct 24, 2026 by vercel[bot]
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.

0 participants