method
port_string
v5.0.0.1 -
Show latest stable
- Class:
ActionDispatch::Http::URL
port_string()public
Returns a string port suffix, including colon, like “:8080” if the port number of this request is not the default HTTP port 80 or HTTPS port 443.
class Request < Rack::Request include ActionDispatch::Http::URL end req = Request.new 'HTTP_HOST' => 'example.com:80' req.port_string # => "" req = Request.new 'HTTP_HOST' => 'example.com:8080' req.port_string # => ":8080"