Expose HTTP response trailers on RestResponse
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Start by locating RestResponseBase and the execution path that consumes HttpResponseMessage content. Check target-framework differences around HttpResponseMessage.TrailingHeaders, then review existing response-header tests. Done means exposing a separate TrailingHeaders collection, populating it after body completion where supported, leaving it empty elsewhere, and verifying trailers remain separate from regular headers.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
.NET exposes HTTP response trailer fields through HttpResponseMessage.TrailingHeaders, but RestSharp currently maps only the regular response headers and content headers to RestResponse. The internal HttpResponseMessage is disposed after execution, so callers using the standard ExecuteAsync path cannot access trailer fields.
Trailer fields are useful for message integrity checks, signatures, delivery metrics, and post-processing status information. RFC 9110 also recommends storing them separately from the initial header section.
Proposed change
- Add a TrailingHeaders collection to RestResponseBase, separate from Headers and ContentHeaders.
- Populate it after the response body has been fully consumed, because .NET exposes received trailers only after content completion.
- Keep the collection empty on target frameworks where HttpResponseMessage.TrailingHeaders is unavailable.
- Add tests verifying that trailers are preserved and remain separate from regular headers.
Compatibility
This would be an additive public API change. RestSharp targets
etstandard2.0, .NET Framework, and modern .NET, so the property can be available on all targets while population is guarded for supported modern .NET targets.
- Ngôn ngữ chính
- C#
- Star
- 9.8k
- Fork
- 2.3k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của restsharp/RestSharp
-
RestClientOptions.UserAgent missing from requests with useClientFactory: trueCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
RestClient configured with Newtonsoft.Json serializer still instantiates System.Text.JsonCó thể đã có người làm @JiuYue0820 đã nhận 57 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
feature-request rfc
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
feature-request rfc
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
Tất cả issue của restsharp/RestSharp
Issue tương tự
-
python triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/semantic-kernel#14590 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nkdAgility/azure-devops-migration-tools#3226 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Status: New
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
dnnsoftware/Dnn.Platform#7556 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày