src/main/scala/s3/website/CloudFront.scala in s3_website-2.8.1 vs src/main/scala/s3/website/CloudFront.scala in s3_website-2.8.3

- old
+ new

@@ -79,12 +79,14 @@ .replaceFirst("^/", "") // S3 keys do not begin with a slash .contains("/") == false // See if the S3 key is a top-level key (i.e., it is not within a directory) ) if (containsPotentialDefaultRootObject) paths :+ "/" else paths } - def withIndexPathIfNeeded(paths: Seq[String]) = { - if (config.cloudfront_invalidate_root.contains(true)) paths :+ "/index.html" else paths - } + def withIndexPathIfNeeded(paths: Seq[String]) = + if (config.cloudfront_invalidate_root.contains(true) && pushSuccessReports.nonEmpty) + paths :+ "/index.html" + else + paths val paths = pushSuccessReports .filter(needsInvalidation) // Assume that redirect objects are never cached. .map(toInvalidationPath) .map(applyInvalidateRootSetting) withIndexPathIfNeeded(withDefaultPathIfNeeded(paths))