Changed the extension filtering from using a blacklist to a whitelist, to avoid a lot of incorrect types.
- Legacy-Id: 13487
This commit is contained in:
parent
64b9615aa7
commit
d5eb59c5a6
|
@ -558,7 +558,7 @@ INTERNET_DRAFT_ARCHIVE_DIR = '/a/www/www6s/draft-archive'
|
|||
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = '/a/www/www6s/archive/id'
|
||||
MEETING_RECORDINGS_DIR = '/a/www/audio'
|
||||
|
||||
DOCUMENT_FORMAT_BLACKLIST = ["tar", "dtd", "p7s"]
|
||||
DOCUMENT_FORMAT_WHITELIST = ["txt", "ps", "pdf", "xml", "html", ]
|
||||
|
||||
# Mailing list info URL for lists hosted on the IETF servers
|
||||
MAILING_LIST_INFO_URL = "https://www.ietf.org/mailman/listinfo/%(list_addr)s"
|
||||
|
|
|
@ -328,7 +328,8 @@ def document_stats(request, stats_type=None):
|
|||
continue
|
||||
|
||||
basename, ext = t
|
||||
if any(ext.lower().endswith(blacklisted_ext.lower()) for blacklisted_ext in settings.DOCUMENT_FORMAT_BLACKLIST):
|
||||
ext = ext.lower()
|
||||
if not any(ext==whitelisted_ext for whitelisted_ext in settings.DOCUMENT_FORMAT_WHITELIST):
|
||||
continue
|
||||
|
||||
canonical_name = doc_names_with_missing_types.get(basename)
|
||||
|
|
Loading…
Reference in a new issue