Merge remote-tracking branch 'pleroma/fix-search-dos' into fix-dos

This commit is contained in:
Alex Gleason 2021-12-12 22:53:13 -06:00
commit fba92a7128
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -17,6 +17,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)
@ -77,7 +79,7 @@ defp search_options(params, user) 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),