mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Return empty response on /api/v1/metrics endpoint if metrics are not enabled
This commit is contained in:
parent
8456f8d4cd
commit
e7f7f39ce8
1 changed files with 4 additions and 0 deletions
|
@ -312,6 +312,10 @@ module Invidious::Routing
|
||||||
get "/api/v1/stats", {{namespace}}::Misc, :stats
|
get "/api/v1/stats", {{namespace}}::Misc, :stats
|
||||||
if CONFIG.statistics_enabled
|
if CONFIG.statistics_enabled
|
||||||
get "/api/v1/metrics", {{namespace}}::Misc, :metrics
|
get "/api/v1/metrics", {{namespace}}::Misc, :metrics
|
||||||
|
else
|
||||||
|
get "/api/v1/metrics" do |env|
|
||||||
|
env.response.status_code = 204
|
||||||
|
end
|
||||||
end
|
end
|
||||||
get "/api/v1/playlists/:plid", {{namespace}}::Misc, :get_playlist
|
get "/api/v1/playlists/:plid", {{namespace}}::Misc, :get_playlist
|
||||||
get "/api/v1/auth/playlists/:plid", {{namespace}}::Misc, :get_playlist
|
get "/api/v1/auth/playlists/:plid", {{namespace}}::Misc, :get_playlist
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue