Skip to content

Commit 62887e7

Browse files
committed
chore: Add custom headers from options in Client.cs
1 parent 85fef9e commit 62887e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Supabase/Client.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ private void Auth_StateChanged(object sender, AuthState e)
244244
/// <inheritdoc />
245245
public Task<BaseResponse> Rpc(string procedureName, object? parameters) =>
246246
_postgrest.Rpc(procedureName, parameters);
247-
247+
248248
/// <inheritdoc />
249249
public Task<TModeledResponse?> Rpc<TModeledResponse>(string procedureName, object? parameters) =>
250250
_postgrest.Rpc<TModeledResponse>(procedureName, parameters);
@@ -272,6 +272,13 @@ internal Dictionary<string, string> GetAuthHeaders()
272272
headers["Authorization"] = $"Bearer {bearer}";
273273
}
274274

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
277+
foreach (var (key, value) in _options.Headers)
278+
{
279+
headers[key] = value;
280+
}
281+
275282
return headers;
276283
}
277284
}

0 commit comments

Comments
 (0)