class ActionDispatch::Routing::RouteSet

def default_env

def default_env
  if default_url_options != @default_env&.[]("action_dispatch.routes.default_url_options")
    url_options = default_url_options.dup.freeze
    uri = URI(ActionDispatch::Http::URL.full_url_for(host: "example.org", **url_options))
    @default_env = {
      "action_dispatch.routes" => self,
      "action_dispatch.routes.default_url_options" => url_options,
      "HTTPS" => uri.scheme == "https" ? "on" : "off",
      "rack.url_scheme" => uri.scheme,
      "HTTP_HOST" => uri.port == uri.default_port ? uri.host : "#{uri.host}:#{uri.port}",
      "SCRIPT_NAME" => uri.path.chomp("/"),
      "rack.input" => "",
    }.freeze
  end
  @default_env
end