Simplify the request_path_startswith helper method

This commit is contained in:
Alex Ling 2020-12-28 16:29:29 +00:00
parent 85ad38c321
commit 93c21ea659

View File

@ -56,12 +56,7 @@ def hash_to_query(hash)
end
def request_path_startswith(env, ary)
ary.each do |prefix|
if env.request.path.starts_with? prefix
return true
end
end
false
ary.any? { |prefix| env.request.path.starts_with? prefix }
end
def requesting_static_file(env)