Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Build the User-Agent header from the assembly version

Đã đóng Phù hợp với người mới
#18 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp

Hướng nghiên cứu

Đọc QuickbaseNet/Services/QuickbaseClient.cs quanh hằng UserAgent và hàm khởi tạo, sau đó đọc QuickbaseNet.UnitTests/Tests/QuickbaseClientTests.cs. Thay phiên bản được ghi cố định bằng phiên bản assembly theo chỉ định và thêm một bài kiểm tra dùng client mới để kiểm tra tiêu đề User-Agent mặc định. Chạy dotnet build và dotnet test --filter FullyQualifiedName~QuickbaseClientTests; hoàn tất khi cả năm framework mục tiêu đều build thành công và bài kiểm tra tiêu đề đạt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C#
Star
3
Fork
2
Merge trung bình
3 giờ 14 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hazeliscoding/quickbase-net

Tất cả issue của hazeliscoding/quickbase-net

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.