http icon indicating copy to clipboard operation
http copied to clipboard

Using WebSocket URIs without ports raises a NoMethodError

Open nomis opened this issue 4 years ago • 0 comments

There is no default_port for the ws and wss schemes.

If the port is omitted, it works with HTTP::URI.parse but not when making requests:

irb(main):001:0> HTTP.get("ws://example")
Traceback (most recent call last):
        1: from (irb):1
NoMethodError (undefined method `default_port' for #<HTTP::URI:0x0056444e3e7798 URI:ws://example/>)

nomis avatar Aug 08 '21 11:08 nomis