Validate DoH/DoH3 endpoint properly

When resolver type is doh/doh3, the endpoint must be a valid http url.

Updates #149
This commit is contained in:
Cuong Manh Le authored and Cuong Manh Le committed 2023-08-29 10:01:06 +07:00
1 parent f7d3db06c6
commit 7ce62ccaec
3 files changed
+38 -1

No files matched your search

+2
View File
@@ -1383,6 +1383,8 @@ func fieldErrorMsg(fe validator.FieldError) string {
return fmt.Sprintf("invalid IP format: %s", fe.Value())
case "file":
return fmt.Sprintf("filed does not exist: %s", fe.Value())
case "http_url":
return fmt.Sprintf("invalid http/https url: %s", fe.Value())
}
return ""
}