Skip to content

Build the User-Agent header from the assembly version #18

Closed

Description

@hazeliscoding

QuickbaseClient sends User-Agent: QuickbaseNet/1.0.1 on every request. The package is at 1.0.2, and release versions come from the git tag, so the hardcoded string goes stale with every release.

What to do

  • Replace the UserAgent constant with a value built from the assembly version: "QuickbaseNet/" + typeof(QuickbaseClient).Assembly.GetName().Version.ToString(3). ToString(3) gives 1.0.2 instead of 1.0.2.0, and it builds on every target, including netstandard2.0 and net48.
  • Add a test to QuickbaseClientTests that creates a client and checks client.Client.DefaultRequestHeaders.UserAgent.ToString(). It reads the header straight off the HttpClient, so no request or mock is needed. Use a new client, not the shared _client: that one replaces Client, which drops the headers set in the constructor.

Where to look

  • QuickbaseNet/Services/QuickbaseClient.cs, lines 18 and 46
  • QuickbaseNet.UnitTests/Tests/QuickbaseClientTests.cs

Done when

  • No version number is hardcoded in QuickbaseClient.cs
  • The new test asserts the header is QuickbaseNet/ plus the assembly's three-part version, and passes
  • dotnet build succeeds for all five target frameworks

Testing it

dotnet build
dotnet test --filter FullyQualifiedName~QuickbaseClientTests

Activity

  1. added
    bug
    good first issue
    on Oct 19, 2026
  2. bercedev commented on Oct 21, 2026

    @bercedev
    Contributor

    I'd like to take this one: replace the UserAgent constant with the assembly-version value from the issue, and add the header test to QuickbaseClientTests on a fresh client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions