raw_host_with_port() public

Returns the host for this request, such as “example.com”.

class Request < Rack::Request
  include ActionDispatch::Http::URL
end

req = Request.new 'HTTP_HOST' => 'example.com'
req.raw_host_with_port # => "example.com"

req = Request.new 'HTTP_HOST' => 'example.com:8080'
req.raw_host_with_port # => "example.com:8080"
Show source
Register or log in to add new notes.