feat(storage): add setHeader method for custom HTTP headers#1313
feat(storage): add setHeader method for custom HTTP headers#1313
Conversation
Add setHeader(key, value) method to both SupabaseStorageClient and StorageFileApi to allow setting per-request HTTP headers on storage operations, matching the supabase-js API. Key behaviors: - Creates shallow copy of headers to avoid mutating shared state - Returns this for method chaining - StorageFileApi instances maintain isolated headers Linear: SDK-691 Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR implements the Assessment against linked issues
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
Summary
Implements
setHeader(key, value)method onSupabaseStorageClientandStorageFileApito allow setting per-request HTTP headers on storage operations, matching the supabase-js API.Changes
setHeader(String key, String value)method that sets a header and returnsthisfor method chainingsetHeader(String key, String value)method with shallow copy of headers to isolate changes between instancesReference Implementation
This matches the supabase-js implementation from:
b1beee6Key Behaviors
thisfor method chainingStorageFileApiinstances maintain isolated headers (setting on one doesn't affect others)Testing
Unit Tests Added
thisfor method chainingsetHeadercallssetHeaderonStorageFileApisets header for that instancesetHeaderonStorageFileApidoes not affect other instancessetHeaderonStorageFileApireturnsthisfor chainingsetHeadercan override existing headersTest Commands
Acceptance Criteria
setHeader(name, value)method implemented on storage base clientLinear Issue
Closes: SDK-691
🤖 Generated with Claude Code