diff options
author | lain <lain@soykaf.club> | 2020-05-05 10:12:37 +0200 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-05-10 02:06:38 +0300 |
commit | 45df70e691495d383a9ceedd620c03a5d3a875ec (patch) | |
tree | b2a97daa7c8074fd0f8fcf13966f5de2c1aff2c6 /test | |
parent | 797dd3f58161982ac8e017d99de26927cf19cf25 (diff) | |
download | pleroma-45df70e691495d383a9ceedd620c03a5d3a875ec.tar.gz pleroma-45df70e691495d383a9ceedd620c03a5d3a875ec.zip |
AP C2S: Restrict creation to `Note`s for now.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/activity_pub/activity_pub_controller_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index 6ab71e2ea..c418232da 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -702,6 +702,21 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert object["content"] == activity["object"]["content"] end + test "it rejects anything beyond 'Note' creations", %{conn: conn, activity: activity} do + user = insert(:user) + + activity = + activity + |> put_in(["object", "type"], "Benis") + + _result = + conn + |> assign(:user, user) + |> put_req_header("content-type", "application/activity+json") + |> post("/users/#{user.nickname}/outbox", activity) + |> json_response(400) + end + test "it inserts an incoming sensitive activity into the database", %{ conn: conn, activity: activity |