Skip to content

RestConnection does not honor Client base URL #106

@ryantse

Description

@ryantse

When creating a RestConnection by passing a Client object, the endpoint URL set in the client is ignored.

Specifically, this call:

    public RestConnection(Client client) throws SparkPostException {
        this(client, "" /* means:set to default endpoint */);
    }

in https://github.com/SparkPost/java-sparkpost/blob/master/libs/sparkpost-lib/src/main/java/com/sparkpost/transport/RestConnection.java#L78

If the Client has a set endpoint already, that should be honored the passing it to the RestClient instead of targeting the default region. i.e.

    public RestConnection(Client client) throws SparkPostException {
        this(client, client.getBaseUrl());
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions