Return empty response on /api/v1/metrics endpoint if metrics are not enabled

This commit is contained in:
wint3rmute 2023-07-20 19:40:43 +02:00 committed by Mateusz Bączek
parent 8456f8d4cd
commit e7f7f39ce8

View File

@ -312,6 +312,10 @@ module Invidious::Routing
get "/api/v1/stats", {{namespace}}::Misc, :stats
if CONFIG.statistics_enabled
get "/api/v1/metrics", {{namespace}}::Misc, :metrics
else
get "/api/v1/metrics" do |env|
env.response.status_code = 204
end
end
get "/api/v1/playlists/:plid", {{namespace}}::Misc, :get_playlist
get "/api/v1/auth/playlists/:plid", {{namespace}}::Misc, :get_playlist