diff options
author | lain <lain@soykaf.club> | 2020-08-12 12:53:04 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-08-12 12:53:04 +0200 |
commit | bb92ad44a6e35c0d67a8f349bd55db4bbb6562cf (patch) | |
tree | a131779d9ac41ca1feec6d7b0750d90bf17aa1d5 /lib/pleroma/web | |
parent | 500576dcb623bdc29193e3b372837c581e151755 (diff) | |
parent | 86c18e4165f1b247af11360535a9daa6ce1641d3 (diff) | |
download | pleroma-bb92ad44a6e35c0d67a8f349bd55db4bbb6562cf.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into reject
Diffstat (limited to 'lib/pleroma/web')
-rw-r--r-- | lib/pleroma/web/controller_helper.ex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex index 69946fb81..6445966e0 100644 --- a/lib/pleroma/web/controller_helper.ex +++ b/lib/pleroma/web/controller_helper.ex @@ -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) |