Move if CONFIG.statistics_enabled into the handler for the /metrics route

This commit is contained in:
Mateusz Bączek
2024-01-23 21:24:08 +01:00
parent 8d4c16c79c
commit 70754659e5
2 changed files with 6 additions and 7 deletions

View File

@@ -29,6 +29,11 @@ module Invidious::Routes::API::V1::Misc
end
def self.metrics(env)
if !CONFIG.statistics_enabled
env.response.status_code = 204
return
end
env.response.content_type = "text/plain"
return String.build do |str|