1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Plugs.SetFormatPlug do
6 import Plug.Conn, only: [assign: 3, fetch_query_params: 1]
11 case get_format(conn) do
13 format -> assign(conn, :format, format)
17 defp get_format(conn) do
18 conn.private[:phoenix_format] ||
19 case fetch_query_params(conn) do
20 %{query_params: %{"_format" => format}} -> format