asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6.02k stars 556 forks source link

IsURL() example.com. is considered valid #349

Open dividinglimits opened 5 years ago

dividinglimits commented 5 years ago

I would be interested to learn where within the RFC3986 specification, a "dot" at the end of the TLD is detailed as allowed.

// https://github.com/asaskevich/govalidator/blob/master/patterns.go#L40
govalidator.IsURL("https://example.com.") evaluates to true, I expected false
dividinglimits commented 5 years ago

256.256.256.256 is also considered valid when it shouldn't be.

ChadTaljaardt commented 5 years ago

@dividinglimits This might be related https://webmasters.stackexchange.com/questions/73934/how-can-urls-have-a-dot-at-the-end-e-g-www-bla-de

whatsadebugger commented 4 years ago

also I have found that underscores are not allowed but they should be

tylitianrui commented 4 years ago

i found it too ,but i think a "dot-end" is not a common usage

puellanivis commented 4 years ago

3.2.2. Host

The rightmost domain label of a fully qualified domain name in DNS may be followed by a single "." and should be if it is necessary to distinguish between the complete domain name and some local domain.

sergeyglazyrindev commented 2 years ago

Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.