# File lib/rack/mock.rb, line 157
      def self.env_with_encoding(env, opts, uri)
        env[REQUEST_METHOD] = opts[:method] ? opts[:method].to_s.upcase : "GET"
        env["SERVER_NAME"] = uri.host || "example.org"
        env["SERVER_PORT"] = uri.port ? uri.port.to_s : "80"
        env[QUERY_STRING] = uri.query.to_s
        env[PATH_INFO] = (!uri.path || uri.path.empty?) ? "/" : uri.path
        env["rack.url_scheme"] = uri.scheme || "http"
        env["HTTPS"] = env["rack.url_scheme"] == "https" ? "on" : "off"
      end