Returns the host for
this request, such as “example.com”.
# File actionpack/lib/action_dispatch/http/url.rb, line 186
def raw_host_with_port
if forwarded = env["HTTP_X_FORWARDED_HOST"].presence
forwarded.split(/,\s?/).last
else
env['HTTP_HOST'] || "#{env['SERVER_NAME'] || env['SERVER_ADDR']}:#{env['SERVER_PORT']}"
end
end