Skip to content

Commit bfc6cab

Browse files
committed
Allow passing client_opts to Electric.Client.new/1
1 parent 4642c69 commit bfc6cab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/phoenix/sync/electric.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,11 @@ defmodule Phoenix.Sync.Electric do
528528
defp http_mode_plug_opts(electric_config) do
529529
with {:ok, client} <- configure_client(electric_config, :http) do
530530
# don't decode the body - just pass it directly
531-
client = %{client | fetch: {Electric.Client.Fetch.HTTP, [request: [raw: true]]}}
531+
request_opts =
532+
Keyword.get(electric_config, :request_opts, [])
533+
|> Keyword.merge(raw: true)
534+
535+
client = %{client | fetch: {Electric.Client.Fetch.HTTP, [request: request_opts]}}
532536
{:ok, %Phoenix.Sync.Electric.ClientAdapter{client: client}}
533537
end
534538
end

0 commit comments

Comments
 (0)