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
2023-08-09 10:01:00 +07:00
committed by Cuong Manh Le
parent f7d3db06c6
commit 7ce62ccaec
3 changed files with 38 additions and 1 deletions

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 ""
}