instance method
standard_port
Ruby on Rails 8.1.2
Since v3.0.20Signature
standard_port()
Returns the standard port number for this request’s protocol.
req = ActionDispatch::Request.new 'HTTP_HOST' => 'example.com:8080' req.standard_port # => 80
Source
# File actionpack/lib/action_dispatch/http/url.rb, line 363
def standard_port
if "https://" == protocol
443
else
80
end
end
Defined in actionpack/lib/action_dispatch/http/url.rb line 363
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Http::URL