-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
isURL(): Allow URLs to have only a username in the userinfo subcompon…
…ent (#1644) * Added some missing options to the isURL() docs * Allow URLs to have a userinfo section with only a username 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).
- Loading branch information
1 parent
9ee1b6b
commit 05ceb18
Showing
3 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters