govalidator icon indicating copy to clipboard operation
govalidator copied to clipboard

URL validation doest not work on url.URL situation

Open arxdsilva opened this issue 8 years ago • 4 comments

Hello!

I'm using this package to validate URLs before inserting it on a DB of a url Shortener, but when moving my shortener to another package I wanted to use the URLs with go's url.URL package. So when I tried to parse It into the validator It returns as true in a test that should not.

Example: Link

arxdsilva avatar Oct 03 '16 21:10 arxdsilva

Also passing (but should not):

&url.URL{
    Scheme: "https",
    Host:   "",
    Path:   "notvalid/path",
}
&url.URL{
    Scheme: "https",
    Host:   "notvalid",
    Path:   "",
},

arxdsilva avatar Oct 04 '16 13:10 arxdsilva

Could you provide stringified examples, please? Something like https:///notvalid/path

asaskevich avatar Jan 05 '17 17:01 asaskevich

https://notvalid/path and https://notvalid are the stringified versions of the above example, which are both valid URLs (e.g.: http://localhost and http://localhost/some/path)

zupzup avatar Jan 05 '17 17:01 zupzup

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.

sergeyglazyrindev avatar Oct 17 '21 21:10 sergeyglazyrindev