fix: fix domain validator with port but no scheme and https or http

This commit is contained in:
Stavros
2026-07-18 18:17:24 +03:00
parent d6087dc45e
commit 50c25e4478
3 changed files with 33 additions and 11 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ func (v *DomainValidator) getURL(i string) (*url.URL, error) {
return nil, ErrInvalidURL
}
if v.opts.WithPort && !v.opts.WithScheme && u.Port() == "" {
if v.opts.WithPort && u.Port() == "" && (u.Scheme != "http" && u.Scheme != "https") {
return nil, fmt.Errorf("port validation is enabled but port is missing in input url and schemes are not enabled")
}