Token update: validate the IP addresses before update.
parent
611765d45d
commit
59304cf751
|
@ -341,15 +341,15 @@ class DNSManager::Storage
|
|||
# Same address, no need to change anything.
|
||||
return Response::Success.new if rr.target == address
|
||||
|
||||
# TODO: validate target?
|
||||
|
||||
case rr
|
||||
when Zone::A
|
||||
return Response::Error.new "invalid ipv4" unless Zone.is_ipv4_address_valid? address
|
||||
rr.target = address
|
||||
zone.update_rr rr
|
||||
zones_by_domain.update_or_create zone.domain, zone
|
||||
Response::Success.new
|
||||
when Zone::AAAA
|
||||
return Response::Error.new "invalid ipv6" unless Zone.is_ipv6_address_valid? address
|
||||
rr.target = address
|
||||
zone.update_rr rr
|
||||
update_zone zone
|
||||
|
|
Loading…
Reference in New Issue