Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Build the User-Agent header from the assembly version

Chiusa Adatta ai principianti
#18 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Leggi QuickbaseNet/Services/QuickbaseClient.cs intorno alla costante UserAgent e al costruttore, poi QuickbaseNet.UnitTests/Tests/QuickbaseClientTests.cs. Sostituisci la versione codificata nel codice con la versione dell’assembly come specificato e aggiungi un test che controlli l’intestazione User-Agent predefinita usando un nuovo client. Esegui dotnet build e dotnet test --filter FullyQualifiedName~QuickbaseClientTests; il lavoro è completato quando tutti e cinque i framework di destinazione vengono compilati e il test dell’intestazione passa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug good first issue

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
Lingua principale
C#
Stelle
3
Fork
2
Merge medio
3h 14m
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hazeliscoding/quickbase-net

Tutte le issue di hazeliscoding/quickbase-net

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.