fix: send coder User-Agent on all deployment requests - #180
Merged
Conversation
jeremyruppel
reviewed
Sep 4, 2026
jeremyruppel
reviewed
Sep 4, 2026
jeremyruppel
approved these changes
Sep 4, 2026
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.
Summary
.NET's HttpClient omits
User-Agentby default, causing AWS WAF to reject requests with403on deployments behind an ALB. This blocked sign-in (/api/v2/buildinfo,/api/v2/users/me), and — because Desktop downloads the tunnel binary from the deployment rather than bundling it — Coder Connect could not start either. Closes #176.What changed
CoderSdk/UserAgent.cs(new): formatsUser-Agentas<token>/<version> (<goos>/<goarch>),e.g.
coder-desktop/0.8.4 (windows/amd64). Platform names follow Go'sGOOS/GOARCHrather than.NET's spelling, so a single pattern matches the CLI, the vpn-daemon and every Desktop client.
SDK HTTP clients:
JsonHttpClient— the single chokepoint bothCoderApiClientandAgentApiClientroute through — now setsDefaultRequestHeaders.UserAgent, selected by aCoderComponentenum (Desktop/Core).DefaultRequestHeadersis deliberate: .NET applies itonly when the request doesn't already carry the header, so caller-supplied headers still win.
Vpn.Service:Manager.csandDownloader.csidentify asCoderComponent.Core, covering thebuildinfo/users-me calls and the tunnel binary download.
Validation
Tests.CoderSdk: 8 → 14 passing (+6UserAgentTest).Tests.Vpn.Service/DownloaderTest.cs: 26 → 28 (+WithUserAgent, +WithUserAg Both assert the header on the wire via the existingTestHttpServerfixture, including that a caller-suppliedUser-Agent` overrides the default.dotnet buildclean, built and ran the arm build with changes, run in windows parallels