Skip to content

Hardcoded http.Client without timeouts #4

Description

@boreq

Hardcoded http.Client prohibits the user from specifying custom timeouts, setting custom cookies etc. Especially the lack of timeouts is deadly as the default client never times out.

Additionally there is no way to use the library multiple times with different http clients without authenticating in order to use the provided constructor functions.

Solution: make the http field of the Client struct public to allow people to set their own httpClient and instantiate the Client at will.

The fact that after this change a global variable in the library will have a state which can be modified externally will however make the NoAuthClient by definition broken which should be noted in the comment above it (as removing it is not an option now without changing the library's API).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions