httpclient icon indicating copy to clipboard operation
httpclient copied to clipboard

Invalid URL scheme should throw an exception

Open shaicoleman opened this issue 9 years ago • 0 comments

HTTPClient doesn't handle properly invalid schemes, and instead of throwing an exception it takes a long time until it timeouts instead.

HTTPClient.new.get('zzz://test.com') HTTPClient::ConnectTimeoutError: execution expired

A better way to handle, would be to throw an exception, like when the scheme is missing, e.g. HTTPClient.new.get('//test.com') ArgumentError: Request URI must have schema. Possibly add 'http://' to the request URI?

shaicoleman avatar Feb 03 '16 17:02 shaicoleman