method

standard_port

standard_port()
public

Returns the standard port number for this request’s protocol.

req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080'
req.standard_port # => 80