mirror of
https://github.com/key-networks/ztncui.git
synced 2025-06-06 02:03:45 +02:00
Validate DNS IP
This commit is contained in:
parent
52b1c47a54
commit
03a8c858af
1 changed files with 6 additions and 1 deletions
|
@ -449,15 +449,20 @@ exports.dns = async function (req, res) {
|
|||
active: 'networks',
|
||||
whence: ''
|
||||
};
|
||||
|
||||
const dns = {
|
||||
dns: {
|
||||
domain: req.body.domain,
|
||||
servers: req.body.servers
|
||||
.split('\n')
|
||||
.map(x => x.trim())
|
||||
.filter(x => !!x)
|
||||
.filter(ip =>
|
||||
new ipaddr.Address4(ip).isValid() ||
|
||||
new ipaddr.Address6(ip).isValid()
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
const network = await zt.network_object(req.params.nwid, dns);
|
||||
navigate.whence = '/controller/network/' + network.nwid;
|
||||
|
|
Loading…
Add table
Reference in a new issue