@@ -236,15 +236,13 @@ private ReplicationResult handleRequest(ReplicationTransaction tx) throws Replic
236
236
private StringEntity createPostBody (ReplicationTransaction tx , String domain , String protocol , String additionalTrimPath , String [] excludepaths ) throws ReplicationException {
237
237
238
238
JsonArray requestedJson = getPathsList (tx , domain , protocol , additionalTrimPath , excludepaths );
239
-
239
+ JsonObject json = new JsonObject ();
240
240
if (requestedJson .size () > 0 ) {
241
- JsonObject json = new JsonObject ();
242
241
json .add ("objects" , requestedJson );
243
- return new StringEntity (json .toString (), CharEncoding .ISO_8859_1 );
244
242
} else {
245
- throw new ReplicationException ("No paths to purge" );
243
+ logReplicationEventInfoStatement ("No paths to purge" );
246
244
}
247
-
245
+ return new StringEntity ( json . toString (), CharEncoding . ISO_8859_1 );
248
246
}
249
247
250
248
/**
@@ -286,6 +284,11 @@ private JsonArray getPathsList(ReplicationTransaction tx, String domain, String
286
284
jsonArray .add (MessageFormat .format ("{0}://{1}{2}" , protocol , domain , pathAfter ));
287
285
}
288
286
}
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
+ }
289
292
}
290
293
291
294
} catch (Exception e ) {
0 commit comments