Repository navigation
feat: Add operator== and hashCode on all header classes - #155
Conversation
…n all headers - Replace .value with .name for RequestMethod enum - Fix test expectations to use lowercase enum names - Remove unnecessary import - Fix const constructor calls in tests - Fix empty list assertions
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- AcceptEncodingHeader - AcceptHeader - AcceptLanguageHeader - AcceptRangesHeader - AccessControlAllowHeadersHeader - AccessControlAllowMethodsHeader - AccessControlAllowOriginHeader - AccessControlExposeHeadersHeader - AuthenticationHeader - AuthorizationHeader - CacheControlHeader - ClearSiteDataHeader - ConnectionHeader - ContentDispositionHeader - ContentEncodingHeader - ContentLanguageHeader - ContentRangeHeader - ContentSecurityPolicyHeader - CookieHeader - CrossOriginEmbedderPolicyHeader - CrossOriginOpenerPolicyHeader - CrossOriginResourcePolicyHeader - ETagConditionHeader - ETagHeader - ExpectHeader - FromHeader - IfRangeHeader - PermissionsPolicyHeader - RangeHeader - ReferrerPolicyHeader - RetryAfterHeader - SecFetchDestHeader - SecFetchModeHeader - SecFetchSiteHeader - SetCookieHeader - StrictTransportSecurityHeader - TEHeader - TransferEncodingHeader - UpgradeHeader - VaryHeader fix: Add missing import of collection fix: Remove unused imports and fix const constructors - Remove unused x_forwarded_for_header imports - Fix const constructor for AccessControlExposeHeadersHeader.wildcard - Fix const constructor for ContentSecurityPolicyHeader - Fix const constructor for PermissionsPolicyHeader - Update various header implementations for consistency
This change converts RequestMethod from a class-based implementation to a proper enum, providing better type safety and more idiomatic Dart code. The enum includes all the same HTTP methods and provides the same codec interface for header parsing.
- AcceptEncodingHeader constructor - AcceptHeader constructor (+ validation) - AcceptLanguageHeader constructor - AccessControlAllowHeadersHeader constructor - AccessControlAllowMethodsHeader constructor - AccessControlExposeHeadersHeader constructor - ClearSiteDataHeader constructor - ContentEncodingHeader constructor - ContentLanguageHeader constructor - ContentSecurityPolicyHeader constructor - CookieHeader constructor - FromHeader constructor - PermissionsPolicyHeader constructor - TEHeader constructor - UpgradeHeader constructor
4fde892 to
1fa3705
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
==========================================
+ Coverage 84.20% 92.43% +8.22%
==========================================
Files 83 83
Lines 2716 3119 +403
Branches 1480 1592 +112
==========================================
+ Hits 2287 2883 +596
+ Misses 429 236 -193 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This improves the usability of HTTP header objects by making them properly comparable and suitable for use in collections. The implementation follows Dart best practices for equality and hash code implementation, ensuring consistent behavior across all header types.
Technical Details:
==operators that compare all relevant fieldsObject.hash()orObject.hashAll()for multiple fieldsListEqualityorIterableEqualityfor deep comparisonRelated Issues
Fixes: #143
Fixes: #144
Fixed: #145
Pre-Launch Checklist
///), ensuring consistency with existing project documentation.Breaking Changes
Some constructor are no longer
constto prevent constructing invalid instances.