Skip to content

Commit

Permalink
Made user info not required for RedisDSN. This will fix the issue pyd…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kesav Kolla authored and Kesav Kolla committed Mar 11, 2020
1 parent 6b48dbe commit 184e8b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pydantic/networks.py
Expand Up @@ -53,7 +53,7 @@ def url_regex() -> Pattern[str]:
if _url_regex_cache is None:
_url_regex_cache = re.compile(
r'(?:(?P<scheme>[a-z][a-z0-9+\-.]+)://)?' # scheme https://tools.ietf.org/html/rfc3986#appendix-A
r'(?:(?P<user>[^\s:/]+)(?::(?P<password>[^\s/]*))?@)?' # user info
r'(?:(?P<user>[^\s:/]+)?(?::(?P<password>[^\s/]*))?@)?' # user info
r'(?:'
r'(?P<ipv4>(?:\d{1,3}\.){3}\d{1,3})|' # ipv4
r'(?P<ipv6>\[[A-F0-9]*:[A-F0-9:]+\])|' # ipv6
Expand Down
3 changes: 3 additions & 0 deletions tests/test_networks.py
Expand Up @@ -452,3 +452,6 @@ class Model(BaseModel):

assert str(Model(v=NameEmail('foo bar', 'foobaR@example.com')).v) == 'foo bar <foobaR@example.com>'
assert str(Model(v='foo bar <foobaR@example.com>').v) == 'foo bar <foobaR@example.com>'

if __name__ == '__main__':
test_redis_dsns()

0 comments on commit 184e8b6

Please sign in to comment.