Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestConnection does not honor Client base URL #106

Open
ryantse opened this issue Sep 13, 2021 · 0 comments
Open

RestConnection does not honor Client base URL #106

ryantse opened this issue Sep 13, 2021 · 0 comments

Comments

@ryantse
Copy link

ryantse commented Sep 13, 2021

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());
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant