Skip to content

parity(storage): implement SetHeader method on storage client [from supabase-js] #232

@grdsdev

Description

@grdsdev

SDK Parity: C# implementation needed

A change was made in supabase-js that needs to be implemented in this repository for SDK parity.

Reference Implementation (supabase-js)

  • Commit: b1beee6
  • PR: #2079
  • Module: storage
  • Type: new-feature

What Changed

A new public setHeader(name, value) method was added to BaseApiClient in storage-js. This allows setting per-request HTTP headers on storage operations.

Code Reference

public setHeader(name: string, value: string): this {
  this.headers = { ...this.headers, [name]: value }
  return this
}

Implementation Guidance

Expected API Surface (C#)

public StorageFileApi SetHeader(string name, string value)
{
    var newHeaders = new Dictionary<string, string>(Headers) { [name] = value };
    Headers = newHeaders;
    return this;
}

Key Behaviors to Match

  • Creates a copy of headers to avoid mutating shared state
  • Returns this for method chaining
  • PascalCase naming per C# conventions

Acceptance Criteria

  • SetHeader(name, value) method implemented on storage client
  • Headers are copied (not mutated) when setting
  • Method chaining supported
  • Unit tests cover happy path and edge cases
  • Documentation updated

Context

  • supabase-js version: v2.95.3
  • Parity tracking: This issue was auto-generated by SDK parity analysis
  • Related parity issues: SDK-691 (dart), SDK-692 (py), SDK-693 (swift)

Generated with Claude Code /sync-sdk-parity

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions