From: Vivian Lim Date: Sun, 24 Jun 2018 06:20:30 +0000 (-0700) Subject: return unquoted empty array from /api/qvitter/mutes.json X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=1299bccc7de1562775de23245bf9922c16329e9a;p=akkoma return unquoted empty array from /api/qvitter/mutes.json --- diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index b65850aaa..4ebb2c368 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -269,7 +269,7 @@ defmodule Pleroma.Web.Router do get("/friendships/no_retweets/ids", TwitterAPI.Controller, :empty_array) get("/mutes/users/ids", TwitterAPI.Controller, :empty_array) - get("/qvitter/mutes", TwitterAPI.Controller, :empty_array) + get("/qvitter/mutes", TwitterAPI.Controller, :raw_empty_array) get("/externalprofile/show", TwitterAPI.Controller, :external_profile) end diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index ff5921807..8f5b3c786 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -404,6 +404,10 @@ defmodule Pleroma.Web.TwitterAPI.Controller do json(conn, Jason.encode!([])) end + def raw_empty_array(conn, _params) do + json(conn, []) + end + def update_profile(%{assigns: %{user: user}} = conn, params) do params = if bio = params["description"] do diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index edc8cbff8..5fcd23d90 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -506,7 +506,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do |> get("/api/qvitter/mutes.json") current_user = Repo.get(User, current_user.id) - assert "[]" = json_response(conn, 200) + assert [] = json_response(conn, 200) end end