refactor(route53): use DomainNames.isWithin for the record set zone check (#6712)

This commit is contained in:
lex00 authored and GitHub committed 2026-10-26 23:24:34 -04:00
1 parent 9e14ffe92a
commit 8a3d769c70
1 file changed
+1 -1
@@ -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);