Skip to content

Commit

Permalink
Ensure format param is respected in content negotiation
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardarella committed Jan 11, 2024
1 parent 1b00d3a commit 87405ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/live_view_native/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule LiveViewNative.Utils do
alias Phoenix.LiveView.Socket

def get_format(%Socket{private: %{connect_info: %{private: %{phoenix_format: format}}}}), do: format
def get_format(%Socket{private: %{connect_params: %{_phoenix_format: format}}}), do: format
def get_format(%Socket{private: %{connect_params: %{"_format" => format}}}), do: format
def get_format(_socket), do: "html"

def get_target(%{socket: %Socket{private: %{connect_info: %{params: %{"target" => target}}}}}), do: target
Expand Down

0 comments on commit 87405ba

Please sign in to comment.