Skip to content

Commit 4668385

Browse files
authored
Merge pull request #67 from aem-design/develop
Develop
2 parents 321b709 + 7862f06 commit 4668385

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

aemdesign-aem-services/src/main/java/design/aem/transport/AkamaiTransportHandler.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,13 @@ private ReplicationResult handleRequest(ReplicationTransaction tx) throws Replic
236236
private StringEntity createPostBody(ReplicationTransaction tx, String domain, String protocol, String additionalTrimPath, String[] excludepaths) throws ReplicationException {
237237

238238
JsonArray requestedJson = getPathsList(tx, domain, protocol, additionalTrimPath, excludepaths);
239-
239+
JsonObject json = new JsonObject();
240240
if (requestedJson.size() > 0) {
241-
JsonObject json = new JsonObject();
242241
json.add("objects", requestedJson);
243-
return new StringEntity(json.toString(), CharEncoding.ISO_8859_1);
244242
} else {
245-
throw new ReplicationException("No paths to purge");
243+
logReplicationEventInfoStatement("No paths to purge");
246244
}
247-
245+
return new StringEntity(json.toString(), CharEncoding.ISO_8859_1);
248246
}
249247

250248
/**
@@ -286,6 +284,11 @@ private JsonArray getPathsList(ReplicationTransaction tx, String domain, String
286284
jsonArray.add(MessageFormat.format("{0}://{1}{2}", protocol, domain, pathAfter));
287285
}
288286
}
287+
288+
// checks for empty ulr list and adds the akamai home page url.
289+
if(jsonArray.size() == 0) {
290+
jsonArray.add(MessageFormat.format("{0}://{1}{2}", protocol, domain, StringUtils.EMPTY));
291+
}
289292
}
290293

291294
} catch (Exception e) {

0 commit comments

Comments
 (0)