diff roundup/cgi/client.py @ 7614:7102de2c8733

refactor: rename the mime type whitelist Whitelist alone is meaningless. Make the purpose of the list more explicit.
author John Rouillard <rouilj@ieee.org>
date Sun, 03 Sep 2023 14:03:11 -0400
parents 978285986b2c
children cc4b11ab2f22
line wrap: on
line diff
--- a/roundup/cgi/client.py	Tue Aug 29 16:16:21 2023 -0400
+++ b/roundup/cgi/client.py	Sun Sep 03 14:03:11 2023 -0400
@@ -1858,7 +1858,7 @@
         # mime type detection is performed in cgi.form_parser
 
         # everything not here is served as 'application/octet-stream'
-        whitelist = [
+        mime_type_allowlist = [
             'text/plain',
             'text/x-csrc',    # .c
             'text/x-chdr',    # .h
@@ -1878,7 +1878,7 @@
         ]
 
         if self.instance.config['WEB_ALLOW_HTML_FILE']:
-            whitelist.append('text/html')
+            mime_type_allowlist.append('text/html')
 
         try:
             mime_type = klass.get(nodeid, 'type')
@@ -1888,7 +1888,7 @@
         if not mime_type:
             mime_type = 'text/plain'
 
-        if mime_type not in whitelist:
+        if mime_type not in mime_type_allowlist:
             mime_type = 'application/octet-stream'
 
         # --/ mime-type security

Roundup Issue Tracker: http://roundup-tracker.org/