Skip to content

Commit 41399c9

Browse files
chore(deps): bump tldextract from 5.2.0 to 5.3.0 (#18002)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Fiedler <[email protected]>
1 parent be9a4c1 commit 41399c9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

requirements/main.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,9 +2267,9 @@ text-unidecode==1.3 \
22672267
--hash=sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8 \
22682268
--hash=sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93
22692269
# via python-slugify
2270-
tldextract==5.2.0 \
2271-
--hash=sha256:59509cbf99628c9440f4d19d3a1fd8488d50297ea23879c136576263c5a04eba \
2272-
--hash=sha256:c3a8c4daf2c25a57f54d6ef6762aeac7eff5ac3da04cdb607130be757b8457ab
2270+
tldextract==5.3.0 \
2271+
--hash=sha256:b3d2b70a1594a0ecfa6967d57251527d58e00bb5a91a74387baa0d87a0678609 \
2272+
--hash=sha256:f70f31d10b55c83993f55e91ecb7c5d84532a8972f22ec578ecfbe5ea2292db2
22732273
# via -r requirements/main.in
22742274
transaction==5.0 \
22752275
--hash=sha256:106e7bd782bcc0cb5119fc9225b0c9a71dfc53adb938be905223adaef22b1174 \

warehouse/accounts/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,12 @@ def validate_email(self, field):
292292

293293
# Check if the domain is valid
294294
extractor = TLDExtract(suffix_list_urls=()) # Updated during image build
295-
domain = extractor(resp.domain.lower()).registered_domain
295+
domain = extractor(resp.domain.lower()).top_domain_under_public_suffix
296296

297297
mx_domains = set()
298298
if hasattr(resp, "mx") and resp.mx:
299299
mx_domains = {
300-
extractor(mx_host.lower()).registered_domain
300+
extractor(mx_host.lower()).top_domain_under_public_suffix
301301
for _prio, mx_host in resp.mx
302302
}
303303
mx_domains.update({mx_host.lower() for _prio, mx_host in resp.mx})
@@ -315,7 +315,7 @@ def validate_email(self, field):
315315
mx_ptr = dns.resolver.resolve_address(mx_ip[0].address)
316316
mx_ptr_domain = extractor(
317317
mx_ptr[0].target.to_text().lower()
318-
).registered_domain
318+
).top_domain_under_public_suffix
319319
all_mx_domains.add(mx_ptr_domain)
320320

321321
# combine both sets

warehouse/admin/views/prohibited_email_domains.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def add_prohibited_email_domain(request):
6969
raise HTTPSeeOther(request.route_path("admin.prohibited_email_domains.list"))
7070
# validate that the domain is valid
7171
extractor = TLDExtract(suffix_list_urls=()) # Updated during image build
72-
registered_domain = extractor(email_domain).registered_domain
72+
registered_domain = extractor(email_domain).top_domain_under_public_suffix
7373
if not registered_domain:
7474
request.session.flash(f"Invalid domain name '{email_domain}'", queue="error")
7575
raise HTTPSeeOther(request.route_path("admin.prohibited_email_domains.list"))

0 commit comments

Comments
 (0)