isURL(): Allow URLs to have only a username in the userinfo subcomponent by jbuchmann-coosto · Pull Request #1644 · validatorjs/validator.js
The 'userinfo' part of a URL may, according to RFC 1738, contain only a username followed by an '@' sign. The previous behavior of the isURL() function would return false if the userinfo section did not have a colon. In addition to the change in the function, tests have been added to ensure the following exmaples are considered valid: - http://user@example.com - http://user:@example.com - http://user:pass@example.com The following are considered not valid: - http://@example.com - http://:@example.com - http://:example.com As a practical example, Sentry (https://github.com/getsentry/sentry) uses a format like http://9b9cd2ef993c1fd9c14cbb88466@example.com/10 for it's DSNs (which are just URLs).