Method: PluginTool.parse_hostname_with_port
- Defined in:
- lib/auth.rb
.parse_hostname_with_port(hostname_with_port) ⇒ Object
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/auth.rb', line 136 def self.parse_hostname_with_port(hostname_with_port) hostname_with_port = hostname_with_port.downcase.strip unless hostname_with_port =~ /\A([a-z0-9\.-]+)(:(\d+))?\z/ end_on_error "Bad hostname #{hostname_with_port}" end hostname = $1 port = $3 ? $3.to_i : 443 server_name = "#{hostname}#{$3 ? ":#{$3}" : ''}" [hostname, port, "https://#{server_name}", server_name] end |