instance method
server_port
Ruby on Rails 5.2.8.1
Since v3.0.20Signature
server_port()
Returns the requested port, such as 8080, based on SERVER_PORT
req = ActionDispatch::Request.new 'SERVER_PORT' => '80' req.server_port # => 80 req = ActionDispatch::Request.new 'SERVER_PORT' => '8080' req.server_port # => 8080
Source
# File actionpack/lib/action_dispatch/http/url.rb, line 323
def server_port
get_header("SERVER_PORT").to_i
end
Defined in actionpack/lib/action_dispatch/http/url.rb line 323
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Http::URL