File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ module Invidious::Routes::API::V1::Misc
2929 end
3030
3131 def self.metrics (env )
32+ if ! CONFIG .statistics_enabled
33+ env.response.status_code = 204
34+ return
35+ end
36+
3237 env.response.content_type = " text/plain"
3338
3439 return String .build do |str |
Original file line number Diff line number Diff line change @@ -310,13 +310,7 @@ module Invidious::Routing
310310
311311 # Misc
312312 get " /api/v1/stats" , {{namespace}}::Misc , :stats
313- if CONFIG .statistics_enabled
314- get " /api/v1/metrics" , {{namespace}}::Misc , :metrics
315- else
316- get " /api/v1/metrics" do |env |
317- env.response.status_code = 204
318- end
319- end
313+ get " /api/v1/metrics" , {{namespace}}::Misc , :metrics
320314 get " /api/v1/playlists/:plid" , {{namespace}}::Misc , :get_playlist
321315 get " /api/v1/auth/playlists/:plid" , {{namespace}}::Misc , :get_playlist
322316 get " /api/v1/mixes/:rdid" , {{namespace}}::Misc , :mixes
You can’t perform that action at this time.
0 commit comments