This repository was archived by the owner on Oct 5, 2023. It is now read-only.
This repository was archived by the owner on Oct 5, 2023. It is now read-only.
Using NewApiWithClient uses HTTP even when HTTPS requested #176
Closed
Description
When using NewApiWithClient
and providing a multiaddress, it results in a HTTP request, even if the multiaddress specifies HTTPS.
For example,
api, _ := NewApiWithClient(ma.NewMultiaddr("/dns4/example.com/tcp/443/https"), &http.Client{})
api.url == "example.com:80"
# in request.go we find
if !strings.HasPrefix(url, "http") {
url = "http://" + url
}
NewApiWithClient
should return a HttpApi
whose url contains the url protocol (http or https).