Skip to content

Commit

Permalink
API: Fix error code for disabled popular endpoint (#4296)
Browse files Browse the repository at this point in the history
When visiting /api/v1/popular and popular endpoint is disabled
Before:

500 {"error":"Closed stream"}

After

403 {"error":"Administrator has disabled this endpoint."}
  • Loading branch information
SamantazFox committed Jul 10, 2024
2 parents 5e0f553 + a9e8aab commit 436a61e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/invidious/routes/api/v1/feeds.cr
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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|
Expand Down

0 comments on commit 436a61e

Please sign in to comment.