Skip to content

Commit 429ab59

Browse files
authored
Update comments
1 parent 037d7de commit 429ab59

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Supabase/Client.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ public Task<BaseResponse> Rpc(string procedureName, object? parameters) =>
249249
public Task<TModeledResponse?> Rpc<TModeledResponse>(string procedureName, object? parameters) =>
250250
_postgrest.Rpc<TModeledResponse>(procedureName, parameters);
251251

252+
/// <summary>
253+
/// Produces dictionary of Headers that will be supplied to child clients.
254+
///</summary>
252255
internal Dictionary<string, string> GetAuthHeaders()
253256
{
254257
var headers = new Dictionary<string, string>
@@ -257,9 +260,7 @@ internal Dictionary<string, string> GetAuthHeaders()
257260
};
258261

259262
if (_supabaseKey != null)
260-
{
261263
headers["apiKey"] = _supabaseKey;
262-
}
263264

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

275-
// Add custom headers from options
276-
// This will overwrite any existing headers with the same key, not sure if that's the desired behavior
276+
// Add supplied headers from `ClientOptions` by developer
277277
foreach (var kvp in _options.Headers)
278-
{
279278
headers[kvp.Key] = kvp.Value;
280-
}
281279

282280
return headers;
283281
}
284282
}
285-
}
283+
}

0 commit comments

Comments
 (0)