Ryan Barrett 2024-03-06 14:04:01 -08:00
rodzic 11a480f1c2
commit 01e5ac51ab
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -2517,6 +2517,9 @@ class WebUtilTest(TestCase):
self.user.key.delete()
self.assertIsNone(Web.owns_id('user.com'))
# extra /, urlparse thinks domain is None
self.assertFalse(Web.owns_id('https:///github.com/puddly'))
def test_owns_id_returns_None(self, *_):
self.user.manual_opt_out = True
self.user.put()

2
web.py
Wyświetl plik

@ -72,7 +72,7 @@ def is_valid_domain(domain):
Valid means TLD is ok, not blacklisted, etc.
"""
if not re.match(DOMAIN_RE, domain):
if not domain or not re.match(DOMAIN_RE, domain):
# logger.debug(f"{domain} doesn't look like a domain")
return False