Mastodon API Controllers: Use the correct params for rate limiting.
authorlain <lain@soykaf.club>
Tue, 26 May 2020 11:45:54 +0000 (13:45 +0200)
committerlain <lain@soykaf.club>
Tue, 26 May 2020 11:45:54 +0000 (13:45 +0200)
lib/pleroma/web/mastodon_api/controllers/account_controller.ex
lib/pleroma/web/mastodon_api/controllers/status_controller.ex

index 75512442de1c352cda4aeb60fc075566aa8cfb6c..47649d41dff3e7da67771b06728d8867d9091f7c 100644 (file)
@@ -81,7 +81,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
 
   plug(
     RateLimiter,
-    [name: :relation_id_action, params: ["id", "uri"]] when action in @relationship_actions
+    [name: :relation_id_action, params: [:id, :uri]] when action in @relationship_actions
   )
 
   plug(RateLimiter, [name: :relations_actions] when action in @relationship_actions)
index 83d997abdf24ed944944b75dd341fb0a8fd64838..f20157a5f36f47067c9f158ef5dd63a6eb3d39d1 100644 (file)
@@ -84,13 +84,13 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
 
   plug(
     RateLimiter,
-    [name: :status_id_action, bucket_name: "status_id_action:reblog_unreblog", params: ["id"]]
+    [name: :status_id_action, bucket_name: "status_id_action:reblog_unreblog", params: [:id]]
     when action in ~w(reblog unreblog)a
   )
 
   plug(
     RateLimiter,
-    [name: :status_id_action, bucket_name: "status_id_action:fav_unfav", params: ["id"]]
+    [name: :status_id_action, bucket_name: "status_id_action:fav_unfav", params: [:id]]
     when action in ~w(favourite unfavourite)a
   )