Repository navigation
fix: never send the API key along a redirect to another host or to plain http - #357
Merged
2 commits merged intoNov 13, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
The Resume button on a paused container sent the start mutation, which
Docker refuses ("cannot start a paused container, try unpause instead"),
so the container stayed paused. A paused container now gets the existing
UnpauseContainer mutation (docker.unpause, available since API 4.29.0, so
on every supported server and without a capability floor); a stopped
container still gets start.
The choice is made once, in UnraidRepository.startContainer(client, id,
paused), the same seam as restartContainer. The Docker tab row and the
container sheet both go through MainViewModel.startContainer(Container).
The demo follows the repository surface: UnraidGateway.startContainer
takes the same flag, and the demo model refuses start on a paused
container like Docker does, so the demo no longer hides the bug.
Closes #345
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ain http
The foreground clients followed redirects, and OkHttp keeps the x-api-key
header when it does, so a 3xx answer moved the key to whatever Location
named: another host, or http after the user entered https. For the
WebSocket the handshake was followed and the key then went out in
connection_init to the new host.
No client that carries the key follows a redirect any more (ADR-0051).
A redirect is reported as the new reason Redirected, naming the target
origin ("The server redirects to https://... Edit the server and enter
that address."), in the tabs, in the Add server sheet's Test and in the
action message. It is no connection problem, so the pill does not say
Offline. Unraid answers http requests with 302 when SSL is Yes or Strict.
Closes #354
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
nofuturekid
force-pushed
the
fix/api-key-does-not-follow-redirects
branch
from
November 13, 2026 21:43
879ab1e to
a6e20ae
Compare
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.
Closes #354
What changed
build,buildLongRunning, and the WebSocket client derived from the base client) no longer follow redirects. OkHttp keepsx-api-keywhen it follows one, so a 3xx used to move the key to theLocationhost or from https down to http; for the WebSocket the handshake was followed and the key then went out inconnection_initto the new host.ErrorReason.Redirectedwith the text "The server redirects to scheme://host[:port]. Edit the server and enter that address." Only the origin is shown (no path, query oruser:password@). It is no connection problem, so the pill does not say Offline. The same text reaches the Array/Docker/VMs tabs (title "The address needs to change"), the Add server sheet's Test (throughclassifyResponse, no change totestConnectionorAddEditServerSheet) and the action snackbar.unraid/webguirc.nginx(commit99e39027fb): with SSL Yes the http port answers every request withreturn 302 https://$host:$PORTSSL...; with Strict it is a302tolan-ip.hash.myunraid.net, a different host name. So the realistic case is a user who typed an http address or a bare IP; the redirect names the address to enter. "Follow only same-host http-to-https upgrades" was rejected: the first request already sent the key over http, and a followed 302 POST becomes a body-less GET.KeyedClientRedirectTest(key never reaches a second server for 301/302/303/307/308 on both HTTP clients; the redirect arrives asRedirectedwith the target; a server without redirect is unchanged; the OkHttp switches; the WebSocket handshake is not followed), classifier, reason, pill and rendering tests. Without the client change four of the fiveKeyedClientRedirectTesttests fail (run before the fix). The old guard "the foreground still follows redirects" inBackgroundClientRedirectTestnow pins the opposite and that cleartext stays allowed in the foreground.Shared files touched:
ApolloClientFactory.kt(base and long-running client builders, twointernalmodifiers),ResponseClassifier.kt(newredirectMessage, three call sites),DomainState.kt(the new enum entry),SnapshotStates.kt(its text inerrorTexts).Left out on purpose
./scripts/local-ci.shgreen on the rebased branch (592 unit tests, 0 failed, 0 skipped).🤖 Generated with Claude Code