Skip to content

Commit d5eb59c

Browse files
committed
Changed the extension filtering from using a blacklist to a whitelist, to avoid a lot of incorrect types.
- Legacy-Id: 13487
1 parent 64b9615 commit d5eb59c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

ietf/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def skip_unreadable_post(record):
558558
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = '/a/www/www6s/archive/id'
559559
MEETING_RECORDINGS_DIR = '/a/www/audio'
560560

561-
DOCUMENT_FORMAT_BLACKLIST = ["tar", "dtd", "p7s"]
561+
DOCUMENT_FORMAT_WHITELIST = ["txt", "ps", "pdf", "xml", "html", ]
562562

563563
# Mailing list info URL for lists hosted on the IETF servers
564564
MAILING_LIST_INFO_URL = "https://www.ietf.org/mailman/listinfo/%(list_addr)s"

ietf/stats/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ def generate_canonical_names(docalias_qs):
328328
continue
329329

330330
basename, ext = t
331-
if any(ext.lower().endswith(blacklisted_ext.lower()) for blacklisted_ext in settings.DOCUMENT_FORMAT_BLACKLIST):
331+
ext = ext.lower()
332+
if not any(ext==whitelisted_ext for whitelisted_ext in settings.DOCUMENT_FORMAT_WHITELIST):
332333
continue
333334

334335
canonical_name = doc_names_with_missing_types.get(basename)

0 commit comments

Comments
 (0)