Light, fluffy, and always free - The AWS Local Emulator alternative
refactor(route53): use DomainNames.isWithin for the record set zone check (#6712)
lex008a3d769c7049
diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/Route53Service.java b/src/main/java/io/github/hectorvent/floci/services/route53/Route53Service.javaindex 95433b66c6..d565229bd9 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/Route53Service.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/Route53Service.java@@ -974,7 +974,7 @@ public class Route53Service implements Resettable {List<ResourceRecordSet> current, String zoneName) {String recordName = normalizeRecordName(rrs.getName());String zone = normalizeRecordName(zoneName);- if (!".".equals(zone) && !recordName.equals(zone) && !recordName.endsWith("." + zone)) {+ if (!".".equals(zone) && !DomainNames.isWithin(recordName, zone)) {throw new AwsException("InvalidChangeBatch","RRSet with DNS name " + normalizeName(rrs.getName()) + " is not permitted in zone "+ normalizeName(zoneName), 400);