Ensure that boolean params in the API are parsed for truthiness (#6575)
Use Rails smart boolean cast to account for values such as "f", "0", "false", etc. Previously, if a param was present in the request, it would count as true.
This commit is contained in:
@ -22,8 +22,4 @@ class Api::V1::Accounts::SearchController < Api::BaseController
|
||||
following: truthy_param?(:following)
|
||||
)
|
||||
end
|
||||
|
||||
def truthy_param?(key)
|
||||
params[key] == 'true'
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user