module ActionDispatch::Http::URL
def normalize_protocol(protocol)
def normalize_protocol(protocol) case protocol when nil "http://" when false, "//" "//" when PROTOCOL_REGEXP "#{$1}://" else raise ArgumentError, "Invalid :protocol option: #{protocol.inspect}" end end