Merge branch 'develop' into feature/gen-magic
[akkoma] / lib / pleroma / web / controller_helper.ex
index 69946fb81ee6a5571728586e8c8fbde681ccb351..6445966e020c09b6e363599afb66baf2e2f51d53 100644 (file)
@@ -18,6 +18,12 @@ defmodule Pleroma.Web.ControllerHelper do
 
   def truthy_param?(value), do: not falsy_param?(value)
 
+  def json_response(conn, status, _) when status in [204, :no_content] do
+    conn
+    |> put_resp_header("content-type", "application/json")
+    |> send_resp(status, "")
+  end
+
   def json_response(conn, status, json) do
     conn
     |> put_status(status)