Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Apr 14, 2021
2 parents 624d165 + 7862f06 commit 9fa6215
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,13 @@ private ReplicationResult handleRequest(ReplicationTransaction tx) throws Replic
private StringEntity createPostBody(ReplicationTransaction tx, String domain, String protocol, String additionalTrimPath, String[] excludepaths) throws ReplicationException {

JsonArray requestedJson = getPathsList(tx, domain, protocol, additionalTrimPath, excludepaths);

JsonObject json = new JsonObject();
if (requestedJson.size() > 0) {
JsonObject json = new JsonObject();
json.add("objects", requestedJson);
return new StringEntity(json.toString(), CharEncoding.ISO_8859_1);
} else {
throw new ReplicationException("No paths to purge");
logReplicationEventInfoStatement("No paths to purge");
}

return new StringEntity(json.toString(), CharEncoding.ISO_8859_1);
}

/**
Expand Down Expand Up @@ -286,6 +284,11 @@ private JsonArray getPathsList(ReplicationTransaction tx, String domain, String
jsonArray.add(MessageFormat.format("{0}://{1}{2}", protocol, domain, pathAfter));
}
}

// checks for empty ulr list and adds the akamai home page url.
if(jsonArray.size() == 0) {
jsonArray.add(MessageFormat.format("{0}://{1}{2}", protocol, domain, StringUtils.EMPTY));
}
}

} catch (Exception e) {
Expand Down

0 comments on commit 9fa6215

Please sign in to comment.