Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Supabase/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,14 @@ private void Auth_StateChanged(object sender, AuthState e)
/// <inheritdoc />
public Task<BaseResponse> Rpc(string procedureName, object? parameters) =>
_postgrest.Rpc(procedureName, parameters);

/// <inheritdoc />
public Task<TModeledResponse?> Rpc<TModeledResponse>(string procedureName, object? parameters) =>
_postgrest.Rpc<TModeledResponse>(procedureName, parameters);

/// <summary>
/// Produces dictionary of Headers that will be supplied to child clients.
///</summary>
internal Dictionary<string, string> GetAuthHeaders()
{
var headers = new Dictionary<string, string>
Expand All @@ -257,9 +260,7 @@ internal Dictionary<string, string> GetAuthHeaders()
};

if (_supabaseKey != null)
{
headers["apiKey"] = _supabaseKey;
}

// In Regard To: https://github.com/supabase/supabase-csharp/issues/5
if (_options.Headers.TryGetValue("Authorization", out var header))
Expand All @@ -272,7 +273,11 @@ internal Dictionary<string, string> GetAuthHeaders()
headers["Authorization"] = $"Bearer {bearer}";
}

// Add supplied headers from `ClientOptions` by developer
foreach (var kvp in _options.Headers)
headers[kvp.Key] = kvp.Value;

return headers;
}
}
}
}