Open orangemail opened 3 years ago
another example is http://invalid-link
@orangemail Thanks for noticing this issue. I have opened pulled request to make sure the validation is correct for IsURL. I hope it gets merged as early as possible so that the users further do not face difficulties.
How do you reproduce it? By updating the regular expression format for the URL, by correcting the misplaced brackets and updating the character to '+'.The char in regular expression mean the means "0 or more occurrences of the preceding item" and + char means "1 or more occurrences of the preceding item" Also there was a misplaced bracket of the form: ( (exp1... ) OR exp2).... instead it should have been of the form: ( (exp1...) ) OR (exp2....) The specified after the form (.[a-zA-Z])* means it can have nil (.com/.eu) but updating it to '+' ensures (.com/.in/.xyz) be specified in the url to make it a valid url
What was the previous behavior? Earlier it used to return true for http://abcd or xyz/qw
which infact is not a valid URL as the domain name is not specified(.com/.eu/.in should be in the URL) which in turn makes the 'govalidator package' work similar to the net/url package with a bug.
https://github.com/asaskevich/govalidator/pull/451 - Fix: Checking of a Valid URL or not
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.
I tried this sample string as input for IsURL(). i.e http://com/networks/
API is returning this as valid URL. Can you please correct it.
I saw this Regex in RFC 2396. Somehow if we can use if inside this API ...it will be more effective.
^(([^:/?#]+):)?(//([^/?#]))?([^?#])(\?([^#]))?(#(.))?