module Roda::RodaPlugins::DeleteEmptyHeaders::ResponseMethods

def delete_empty_headers(res)

Delete any empty headers from response
def delete_empty_headers(res)
  res[1].delete_if{|_, v| v.is_a?(String) && v.empty?}
  res
end

def finish

Delete any empty headers when calling finish
def finish
  delete_empty_headers(super)
end

def finish_with_body(_)

Delete any empty headers when calling finish_with_body
def finish_with_body(_)
  delete_empty_headers(super)
end