-
-
Notifications
You must be signed in to change notification settings - Fork 143
feat: add standard client headers #685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add standard client headers #685
Conversation
Pull Request Test Coverage Report for Build 13698748167Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 14795739369Details
💛 - Coveralls |
9c3b783
to
d41a530
Compare
d41a530
to
ceb9742
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces standard client headers to the Supabase client and updates the related test assets. Key changes include:
- Refactoring header initialization in SupabaseClient to use defaultHeaders.
- Adding new client header values for platform and platform version.
- Updating tests to assert the new header structure using inline snapshots.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
Tests/SupabaseTests/SupabaseClientTests.swift | Updated tests to validate the new header values with snapshots. |
Sources/Supabase/SupabaseClient.swift | Refactored header setup to merge default and custom headers. |
Sources/Supabase/Constants.swift | Added a defaultHeaders closure generating standard headers. |
Sources/Helpers/Version.swift | Updated version and platform logic using new Swift patterns. |
Package.swift | Added InlineSnapshotTesting dependency for enhanced snapshot tests. |
Comments suppressed due to low confidence (2)
Sources/Supabase/SupabaseClient.swift:163
- [nitpick] Consider extracting the headers merging logic into a helper function to improve readability and ease future maintenance.
_headers = HTTPFields(defaultHeaders).merging(with: HTTPFields([...]))
Tests/SupabaseTests/SupabaseClientTests.swift:67
- [nitpick] The inline snapshot contains hard-coded header values; be aware that any future changes to header generation logic may require updating this snapshot to avoid false negatives.
assertInlineSnapshot(of: client.headers, as: .customDump) {
Co-authored-by: Copilot <[email protected]>
What kind of change does this PR introduce?
Bug fix, feature, docs update, ...
What is the current behavior?
Please link any relevant issues here.
What is the new behavior?
Feel free to include screenshots if it includes visual changes.
Additional context
Add any other context or screenshots.