Do not set endpoint if it is an empty string

Also do not pass along endpoint as an override if we set it via the
builder.  Fixes #229.
pull/239/head
Andrew Gaul 2017-07-08 19:44:30 -07:00
rodzic 23705a879b
commit 17294be152
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -272,6 +272,7 @@ public final class Main {
String credential = properties.getProperty(
Constants.PROPERTY_CREDENTIAL);
String endpoint = properties.getProperty(Constants.PROPERTY_ENDPOINT);
properties.remove(Constants.PROPERTY_ENDPOINT);
String region = properties.getProperty(
LocationConstants.PROPERTY_REGION);
@ -306,7 +307,7 @@ public final class Main {
.credentials(identity, credential)
.modules(ImmutableList.<Module>of(new SLF4JLoggingModule()))
.overrides(properties);
if (endpoint != null) {
if (!Strings.isNullOrEmpty(endpoint)) {
builder = builder.endpoint(endpoint);
}