Closed nmfisher closed 5 years ago
@nmfisher hello. You get this issue because connection URI is created in the getter connectUri
as 'http://$host:$port';. And if you prepend the protocol to host
parameter, then connection URI will be like 'http://http://10.0.2.2:$port';
. This isn't checking right now because for connection mostly is used HTTP/1.1 protocol without SSL. So it's no reason to pass protocol prefix.
I haven't created an opportunity to choose between http://
and https://
, but I will make it.
Thanks @YevhenKap - I'd still suggest adding a URI sanity check, even if only http is supported. It prevents developers like me from doing stupid things :) Silent errors suck, and malformed config parameters are an easy mistake to make when you're trying out a new library.
I have a few other issues I've come across (e.g. a null username/password should be treated as anonyous authentication and shouldn't set any Authorization header). Did you want me to raise issues as I find them?
@nmfisher yes, of course, you can raise issues) Even more I need it)
Are you also OK for me to submit PRs for these issues?
You can do this. Read CONTRIBUTING.md.
I fix this issue - 0.5.0
If the host is specified with a protocol prefix (i.e. "http://10.0.2.2" rather than "10.0.2.2", any operations will fail silently
For some reason this doesn't trigger catchError (or maybe it's stuck in a retry/timeout loop and I never waited long enough for the callback to resolve). Either way, given CouchDbClient prepends "http://" to the connect URI, which doesn't get picked up by Uri.parse (presumably it's actually a valid URI, just obviously not the one we wanted).
Is it worthwhile adding a check for this?