Method: ActionDispatch::Http::URL#host
- Defined in:
- actionpack/lib/action_dispatch/http/url.rb
#host ⇒ Object
Returns the host for this request, such as “example.com”.
req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080'
req.host # => "example.com"
228 229 230 |
# File 'actionpack/lib/action_dispatch/http/url.rb', line 228 def host raw_host_with_port.sub(/:\d+$/, "") end |