Commit ea537e11 authored by Ryan Cobb's avatar Ryan Cobb

Move param substitution to method

parent ead1078f
......@@ -114,11 +114,7 @@ module Prometheus
end
def filter_params(params, path)
start_time = params[:start_time]
end_time = params[:end_time]
params['start'] = start_time if start_time
params['end'] = end_time if end_time
params = substitute_params(params)
params.slice(*PROXY_SUPPORT.dig(path, :params))
end
......@@ -126,5 +122,15 @@ module Prometheus
def can_proxy?
PROXY_SUPPORT.dig(@path, :method)&.include?(@method)
end
def substitute_params(params)
start_time = params[:start_time]
end_time = params[:end_time]
params['start'] = start_time if start_time
params['end'] = end_time if end_time
params
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment