From 87405ba0987dbffa009fa9ef24c3c17143e3747d Mon Sep 17 00:00:00 2001 From: Brian Cardarella Date: Thu, 11 Jan 2024 14:56:53 -0500 Subject: [PATCH] Ensure format param is respected in content negotiation --- lib/live_view_native/utils.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/live_view_native/utils.ex b/lib/live_view_native/utils.ex index bda746d7..05195a49 100644 --- a/lib/live_view_native/utils.ex +++ b/lib/live_view_native/utils.ex @@ -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