Add HttpHeadersExtensions with TryGetValue and GetValuesOrEmpty#68
Merged
Add HttpHeadersExtensions with TryGetValue and GetValuesOrEmpty#68
Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/8d264551-22b4-47c3-b013-e96594109e12 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Tyrrrz
April 19, 2026 07:46
View session
Tyrrrz
reviewed
Apr 19, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prime #68 +/- ##
==========================================
- Coverage 94.85% 94.07% -0.79%
==========================================
Files 120 128 +8
Lines 2333 2496 +163
Branches 177 198 +21
==========================================
+ Hits 2213 2348 +135
- Misses 86 107 +21
- Partials 34 41 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tyrrrz
reviewed
Apr 19, 2026
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/767f4f7e-84a9-4c7b-b7be-954ce22ef0b1 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Ports a header helper into PowerKit by adding an HttpHeaders extension method that attempts to retrieve a header value as a string?, with accompanying unit tests.
Changes:
- Added
HttpHeadersExtensions.TryGetValue(string name)forSystem.Net.Http.Headers.HttpHeaders - Added tests covering present, absent, and multi-value headers
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| PowerKit/Extensions/HttpHeadersExtensions.cs | Introduces the HttpHeaders extension method that retrieves header values as a nullable string |
| PowerKit.Tests/Extensions/HttpHeadersExtensionsTests.cs | Adds xUnit coverage for the new extension method’s behaviors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ions Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/9eeb00e5-1e2a-4013-b9f6-7002d623cbe3 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot
AI
changed the title
Add HttpHeadersExtensions with TryGetValue
Add HttpHeadersExtensions with TryGetValue and TryGetValues
Apr 19, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Tyrrrz
reviewed
Apr 19, 2026
Tyrrrz
reviewed
Apr 19, 2026
Tyrrrz
reviewed
Apr 19, 2026
Tyrrrz
reviewed
Apr 19, 2026
…Values Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/67304ab9-4ae6-4690-9817-3c336c581b1e Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…keep TryGetValues name (GetValues conflicts with BCL) Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/25be9da9-ac15-469d-8302-5d7328cc0f44 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/95fae6d5-c101-4000-9acb-6e2e3d61f46d Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot
AI
changed the title
Add HttpHeadersExtensions with TryGetValue and TryGetValues
Add HttpHeadersExtensions with TryGetValue and GetValuesOrEmpty
Apr 19, 2026
Tyrrrz
reviewed
Apr 19, 2026
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/c1cb9bef-e828-4dd4-92b2-06702e4773e5 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports
HttpExtensionsfrom DiscordChatExporter into PowerKit asHttpHeadersExtensions, extendingSystem.Net.Http.Headers.HttpHeaders.Changes
PowerKit/Extensions/HttpHeadersExtensions.cs— adds two extension methods onHttpHeaders:GetValuesOrEmpty(string name): returns all header values asIEnumerable<string>, or an empty sequence if absentTryGetValue(string name): returns all header values joined with", "asstring, or an empty string if absent; delegates toGetValuesOrEmptyPowerKit.Tests/Extensions/HttpHeadersExtensionsTests.cs— covers found, not found, and multi-value cases for both methodsUsage