diff --git a/aemdesign-aem-services/src/main/java/design/aem/transport/AkamaiTransportHandler.java b/aemdesign-aem-services/src/main/java/design/aem/transport/AkamaiTransportHandler.java index ef32610b8..0afcf1ac4 100644 --- a/aemdesign-aem-services/src/main/java/design/aem/transport/AkamaiTransportHandler.java +++ b/aemdesign-aem-services/src/main/java/design/aem/transport/AkamaiTransportHandler.java @@ -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); } /** @@ -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) {