Skip to content

Commit 84a88d3

Browse files
authored
Don't require host to be valid (#46)
1 parent f4b84c2 commit 84a88d3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/rfc3986/validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def subauthority_component_is_valid(uri, component):
416416
# If we can parse the authority into sub-components and we're not
417417
# validating the port, we can assume it's valid.
418418
if component == 'host':
419-
return host_is_valid(subauthority_dict['host'], require=True)
419+
return host_is_valid(subauthority_dict['host'])
420420
elif component != 'port':
421421
return True
422422

tests/test_validators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def test_passwordless_uris_pass_validation(uri):
105105
])
106106
def test_missing_host_component(uri):
107107
"""Verify that missing host components cause errors."""
108+
validators.Validator().validate(uri)
109+
108110
validator = validators.Validator().require_presence_of('host')
109111
with pytest.raises(exceptions.MissingComponentError):
110112
validator.validate(uri)

0 commit comments

Comments
 (0)