Repository navigation
feat(app): custom request headers for server connections - #67676
Open
biggestcookie wants to merge 3 commits into
Open
biggestcookie wants to merge 3 commits into
biggestcookie wants to merge 3 commits into
Conversation
biggestcookie
force-pushed
the
custom-server-headers
branch
2 times, most recently
from
December 4, 2026 18:57
43eba72 to
3eb43cf
Compare
Add request headers to the Add Server dialog and connect screen. In password mode a Headers section lists name/value rows with a remove action and a small Add header button, matching the mobile client. Saved headers are sent on every request to the server (API client, health checks, uploads), and an explicit Authorization header takes precedence over the Basic auth generated from the password. Refs anomalyco#64673
Reject header rows a browser cannot send: non-token names, the Fetch forbidden list, control characters in values, and case-insensitive duplicates. Each row explains the problem and blocks submit; the request path trims, deduplicates and drops unsendable rows so a stored or plugin-written entry cannot throw or vanish silently. A saved authorization now replaces the generated Basic header regardless of case, and media falls back to the API download when the connection has custom headers.
Ports the header coverage the old stories had after upstream replaced them with Lab pages, and fixes the edit target those pages build now that ServerOriginal carries headers.
biggestcookie
force-pushed
the
custom-server-headers
branch
from
December 4, 2026 19:14
3eb43cf to
962d526
Compare
biggestcookie
marked this pull request as ready for review
December 4, 2026 19:14
This branch has not been deployed
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.
Issue for this PR
Closes #64673
Type of change
What does this PR do?
Ports the ability from the OpenCode mobile app to add custom request headers in the 'Add server' dialog in the desktop and web UI.
This allows clients to reach a server behind a gateway or reverse proxy that needs its own headers (such as service tokens, tenant IDs, Bearer auth).
When adding a server with the password method, the dialog now shows a Headers section below the password field. Add header appends a name/value row with a remove button. Rows are saved with the connection and sent on the API client, the health probe and the event stream.
The behavior is opt-in per connection, and nothing is sent until a header row is added.
Notes:
Host,Cookie,Content-Length,Origin,Proxy-*,Sec-*, …) is rejected. Values reject CR/LF/NUL and other control characters. Duplicate names are flagged case-insensitively. Empty rows are ignored, and a value without a name is flagged.<video>/<audio>cannot send headers, so media falls back to the API download when a connection has custom headers.How did you verify your code works?
packages/app:bun typecheckandbun run typecheck:tscpass, andbun run testpasses (3,169 unit tests and 394 browser tests, 0 failures)./api/infoand on the/api/eventstream.Screenshots / recordings
Connect screen:
Add server dialog:
Related
Checklist