Skip to content

Commit

Permalink
Do not set endpoint if it is an empty string
Browse files Browse the repository at this point in the history
Also do not pass along endpoint as an override if we set it via the
builder.  Fixes #229.
  • Loading branch information
gaul committed Jul 9, 2017
1 parent 23705a8 commit 17294be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/gaul/s3proxy/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ private static BlobStore createBlobStore(Properties properties)
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);

Expand Down Expand Up @@ -306,7 +307,7 @@ private static BlobStore createBlobStore(Properties properties)
.credentials(identity, credential)
.modules(ImmutableList.<Module>of(new SLF4JLoggingModule()))
.overrides(properties);
if (endpoint != null) {
if (!Strings.isNullOrEmpty(endpoint)) {
builder = builder.endpoint(endpoint);
}

Expand Down

0 comments on commit 17294be

Please sign in to comment.