Skip to content
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
@rossjones

Description

@rossjones

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions