Previously a call like @(connect {:uri "http://localhost"}) would throw an exception when Integer/parseInt is given a null port number. Now instead:
When URI contains a port, it is used as before, else:
When URI scheme is http, port is 80
When URI scheme is https, port is 443
A call like @(connect {:uri "localhost"}) doesn't work because lambdaisland/uri returns nil for :host for such a string. This doesn't seem like a particularly important use case though.
Also refactor test ssl-check to use some common code that new test port-check uses, and use the scheme to determine the ssl parameter as a simplification. The port-check test checks stub calls instead of making an actual connection as this is much easier to test these scenarios that way.
https://github.com/protojure/lib/issues/134
Previously a call like
@(connect {:uri "http://localhost"})
would throw an exception whenInteger/parseInt
is given a null port number. Now instead:http
, port is80
https
, port is443
A call like
@(connect {:uri "localhost"})
doesn't work becauselambdaisland/uri
returnsnil
for:host
for such a string. This doesn't seem like a particularly important use case though.Also refactor test
ssl-check
to use some common code that new testport-check
uses, and use the scheme to determine thessl
parameter as a simplification. Theport-check
test checks stub calls instead of making an actual connection as this is much easier to test these scenarios that way.