409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
# File 'actionpack/lib/action_dispatch/routing/route_set.rb', line 409
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
|