Skip to content

Commit b6c0e58

Browse files
committed
refactor: rename the mime type whitelist
Whitelist alone is meaningless. Make the purpose of the list more explicit.
1 parent c5c6ec9 commit b6c0e58

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roundup/cgi/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ def serve_file(self, designator, dre=dre):
18581858
# mime type detection is performed in cgi.form_parser
18591859

18601860
# everything not here is served as 'application/octet-stream'
1861-
whitelist = [
1861+
mime_type_allowlist = [
18621862
'text/plain',
18631863
'text/x-csrc', # .c
18641864
'text/x-chdr', # .h
@@ -1878,7 +1878,7 @@ def serve_file(self, designator, dre=dre):
18781878
]
18791879

18801880
if self.instance.config['WEB_ALLOW_HTML_FILE']:
1881-
whitelist.append('text/html')
1881+
mime_type_allowlist.append('text/html')
18821882

18831883
try:
18841884
mime_type = klass.get(nodeid, 'type')
@@ -1888,7 +1888,7 @@ def serve_file(self, designator, dre=dre):
18881888
if not mime_type:
18891889
mime_type = 'text/plain'
18901890

1891-
if mime_type not in whitelist:
1891+
if mime_type not in mime_type_allowlist:
18921892
mime_type = 'application/octet-stream'
18931893

18941894
# --/ mime-type security

0 commit comments

Comments
 (0)