mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-06-24 19:33:11 +03:00
feat: add custom port support to dns
This commit is contained in:
@@ -7,11 +7,14 @@ export function validateDNS(value: string): ValidationResult {
|
||||
return { valid: false, message: _('DNS server address cannot be empty') };
|
||||
}
|
||||
|
||||
if (validateIPV4(value).valid) {
|
||||
const cleanedValueWithoutPort = value.replace(/:(\d+)(?=\/|$)/, '');
|
||||
const cleanedIpWithoutPath = cleanedValueWithoutPort.split('/')[0];
|
||||
|
||||
if (validateIPV4(cleanedIpWithoutPath).valid) {
|
||||
return { valid: true, message: _('Valid') };
|
||||
}
|
||||
|
||||
if (validateDomain(value).valid) {
|
||||
if (validateDomain(cleanedValueWithoutPort).valid) {
|
||||
return { valid: true, message: _('Valid') };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user