Skip to content

fix: send coder User-Agent on all deployment requests - #7

Merged
untra merged 1 commit into
mainfrom
user-agent-header
Sep 4, 2026
Merged

fix: send coder User-Agent on all deployment requests#7
untra merged 1 commit into
mainfrom
user-agent-header

Conversation

@untra

@untra untra commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

.NET's HttpClient omits User-Agent by default, causing AWS WAF to reject requests with 403 (NoUserAgent_HEADER). This blocked both sign-in (/api/v2/buildinfo) and Coder Connect tunnel binary downloads. Additionally, shipped assemblies defaulted to version 1.0.0 because packaging scripts omitted /p:Version.

What changed

  • CoderSdk/UserAgent.cs: Formats User-Agent as <token>/<version> (<goos>/<goarch>) (e.g., coder-desktop/0.8.4 (linux/amd64)).
  • SDK HTTP Clients: Updated JsonHttpClient, CoderApiClient, and AgentApiClient to set DefaultRequestHeaders.UserAgent via a CoderComponent enum (Desktop or Core). Caller-supplied headers still take precedence.
  • Vpn.Service: Updated Manager.cs and Downloader.cs to identify as CoderComponent.Core for service and tunnel binary downloads.
  • Packaging: Passed /p:Version in build-release-packages.sh and PKGBUILD so published assemblies carry true release versions.

Validation

  • Tests: Expanded suite from 58 to 65 passing tests (+5 UserAgentTest, +2 DownloaderTest). Included mutation checks to verify test coverage on DefaultRequestHeaders.
  • Packaging: Verified arm64 deb and tar.gz build cleanly with VERSION=0.9.0.

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

DEVEX-778

@untra
untra added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 07a6485 Sep 4, 2026
1 check passed
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.

2 participants