module Roda::RodaPlugins::Public::RequestMethods

def public_serve_with(server)

def public_serve_with(server)
  return unless is_get?
  path = PARSER.unescape(real_remaining_path)
  return if path.include?("\0")
  roda_opts = roda_class.opts
  path = ::File.join(server.root, *public_path_segments(path))
  if accept_encoding = env['HTTP_ACCEPT_ENCODING']
    roda_opts[:public_encodings].each do |enc, ext, regexp|
      if regexp.send(MATCH_METHOD, accept_encoding)
        public_serve_compressed(server, path, ext, enc)
      end
    end
  end
  if public_file_readable?(path)
    s, h, b = public_serve(server, path)
    headers = response.headers
    headers.replace(h)
    halt [s, headers, b]
  end
end