diff options
author | lain <lain@soykaf.club> | 2020-08-11 17:49:24 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-08-11 17:49:24 +0200 |
commit | 0589e9156ac4f77bf158ed65bd352b4725f0ad1c (patch) | |
tree | bbe38007fbc918f96b46564a9af2e619d716f32f /lib/pleroma/web | |
parent | 677abbf0ee8d44f88e40f21526c401eb4ed8cc05 (diff) | |
parent | c66f6bd0ad130eb59c3c1e7edfbbddddf6772864 (diff) | |
download | pleroma-0589e9156ac4f77bf158ed65bd352b4725f0ad1c.tar.gz |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into fix/activity-expirations-again
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) |