Compare commits

...

3 Commits

Author SHA1 Message Date
Richard Lora e0f20b0641 style(feeds.cr): fix code formatting 2024-05-03 14:00:28 -04:00
Richard Lora 3abf21625c fix(search.cr): http status code 2024-05-03 10:38:57 -04:00
Richard Lora 5fa293541b
fix(feeds.cr): http status code 2024-05-03 10:36:43 -04:00
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ module Invidious::Routes::API::V1::Feeds
if !CONFIG.trending_enabled
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
haltf env, 400, error_message
haltf env, 403, error_message
end
region = env.params.query["region"]?
@ -36,7 +36,7 @@ module Invidious::Routes::API::V1::Feeds
if !CONFIG.popular_enabled
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
haltf env, 400, error_message
haltf env, 403, error_message
end
JSON.build do |json|

View File

@ -7,7 +7,7 @@ module Invidious::Routes::API::V1::Search
if !CONFIG.search_enabled
error_message = {"error" => "Administrator has disabled this endpoint."}.to_json
haltf env, 400, error_message
haltf env, 403, error_message
end
query = Invidious::Search::Query.new(env.params.query, :regular, region)

View File

@ -44,7 +44,7 @@ module Invidious::Routes::Feeds
def self.trending(env)
locale = env.get("preferences").as(Preferences).locale
if CONFIG.trending_enabled
trending_type = env.params.query["type"]?
trending_type ||= "Default"