protojure / lib

A collection of libraries to support Protojure applications at runtime
https://protojure.readthedocs.io
Apache License 2.0
64 stars 14 forks source link

Enhancement: infer missing port in URI's from connection scheme when possible #137

Closed reify-james-vickers closed 2 years ago

reify-james-vickers commented 2 years ago

https://github.com/protojure/lib/issues/134

Previously a call like @(connect {:uri "http://localhost"}) would throw an exception when Integer/parseInt is given a null port number. Now instead:

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.

ghaskins commented 2 years ago

@reify-james-vickers I cut a new release with your two PRs

https://clojars.org/io.github.protojure/core/versions/2.1.2