instance method
raw_host_with_port
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
raw_host_with_port()
Returns the \host for this request, such as “example.com”.
Source
# File actionpack/lib/action_controller/request.rb, line 275
def raw_host_with_port
if forwarded = env["HTTP_X_FORWARDED_HOST"]
forwarded.split(/,\s?/).last
else
env['HTTP_HOST'] || "#{env['SERVER_NAME'] || env['SERVER_ADDR']}:#{env['SERVER_PORT']}"
end
end
Defined in actionpack/lib/action_controller/request.rb line 275
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::Request