From: Lady Lumb <42786600+LadyLumb@users.noreply.github.com> Date: Fri, 31 May 2019 08:48:11 +0000 (-0700) Subject: Add env variable to control search limit X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=0ed0c77266b82f313dec196d82edcc0aef5c2ae5;p=mastodon.git Add env variable to control search limit Changed the default search limit to allow a variable called MAX_SEARCH_RESULTS in the .env.production file to change the maximum search results limit. --- diff --git a/app/controllers/api/v1/search_controller.rb b/app/controllers/api/v1/search_controller.rb index 6131cbbb6..4fb869bb9 100644 --- a/app/controllers/api/v1/search_controller.rb +++ b/app/controllers/api/v1/search_controller.rb @@ -3,7 +3,7 @@ class Api::V1::SearchController < Api::BaseController include Authorization - RESULTS_LIMIT = 20 + RESULTS_LIMIT = (ENV['MAX_SEARCH_RESULTS'] || 20).to_i before_action -> { doorkeeper_authorize! :read, :'read:search' } before_action :require_user!