Merge remote-tracking branch 'upstream/develop' into develop
[akkoma] / lib / pleroma / web / mastodon_api / controllers / search_controller.ex
index c8f820f003949e17dcf0fe903432715b5aaab199..86ad388fd9d7aeba6da71b8fb91ff610d89aa0ed 100644 (file)
@@ -13,6 +13,8 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
 
   require Logger
 
+  @search_limit 40
+
   plug(Pleroma.Web.ApiSpec.CastAndValidate)
 
   # Note: Mastodon doesn't allow unauthenticated access (requires read:accounts / read:search)
@@ -52,7 +54,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
     [
       resolve: params[:resolve],
       following: params[:following],
-      limit: params[:limit],
+      limit: min(params[:limit], @search_limit),
       offset: params[:offset],
       type: params[:type],
       author: get_author(params),