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