Skip to content

Commit 0210588

Browse files
committed
Tweaked the mime type validator so it can be called also when there's no required mime types.
- Legacy-Id: 14779
1 parent 07229b7 commit 0210588

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ietf/utils/validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def validate_mime_type(file, valid):
8080
if mime_type == 'text/x-c++' and re.search('(?m)^virtual\s', raw):
8181
mod = raw.replace(str('virtual'), str(' virtual'))
8282
mime_type, encoding = get_mime_type(mod)
83-
if not mime_type in valid:
83+
if valid and not mime_type in valid:
8484
raise ValidationError('Found content with unexpected mime type: %s. Expected one of %s.' %
8585
(mime_type, ', '.join(valid) ))
8686
return mime_type, encoding

0 commit comments

Comments
 (0)