instance method
raw_host_with_port
Ruby on Rails 4.2.9
Since v3.0.20Signature
raw_host_with_port()
Returns the \host for this request, such as “example.com”.
Source
# 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
Defined in actionpack/lib/action_dispatch/http/url.rb line 186
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Http::URL