Skip to content

fix(client): build the User-Agent from the assembly version - #22

Merged
hazeliscoding merged 1 commit into
hazeliscoding:masterfrom
bercedev:fix/user-agent-from-assembly
Oct 21, 2026
Merged

hazeliscoding merged 1 commit into
hazeliscoding:masterfrom
bercedev:fix/user-agent-from-assembly

Conversation

@bercedev

Copy link
Copy Markdown
Contributor

Closes #18

QuickbaseClient sent the hardcoded User-Agent: QuickbaseNet/1.0.1, but the package is at 1.0.2. As the issue suggests, the constant is now a static readonly built from typeof(QuickbaseClient).Assembly.GetName().Version.ToString(3), so it follows <Version> (and the tag-driven release versions) without editing the file. No version number is left in QuickbaseClient.cs.

Test: QuickbaseClientTests.Constructor_SetsUserAgentFromAssemblyVersion creates its own client (not the shared _client, which replaces Client). It checks client.Client.DefaultRequestHeaders.UserAgent.ToString() against QuickbaseNet/ plus the assembly's three-part version. On main it fails with Expected: QuickbaseNet/1.0.2, Actual: QuickbaseNet/1.0.1.

I ran it offline in the .NET 8 SDK container on Linux. dotnet build succeeds for all five targets (netstandard2.0, netstandard2.1, net5.0, net6.0, net48), and dotnet test passes 8 tests, 0 failed.

Note: I used Claude Code while working on this.

The hardcoded QuickbaseNet/1.0.1 went stale with each release; the package is at 1.0.2.

@hazeliscoding hazeliscoding left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks also for the AI-usage transparency, not a lot of people do that.

@hazeliscoding
hazeliscoding merged commit 3a9cb32 into hazeliscoding:master Oct 21, 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.

Build the User-Agent header from the assembly version

2 participants