Skip to content

Commit

Permalink
Add extra
Browse files Browse the repository at this point in the history
  • Loading branch information
lferran committed Aug 22, 2024
1 parent e679d7a commit 62dc811
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nucliadb/tests/standalone/integration/test_upload_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def test_invalid_content_types(content_type):
("data.xml", "application/xml"),
# Archive files
("archive.zip", "application/zip"),
("fooo.rar", "application/x-rar-compressed"),
("fooo.rar", ["application/x-rar-compressed", "application/vnd.rar"]),
("archive.tar", "application/x-tar"),
("archive.tar.gz", "application/x-tar"),
# Invalid content types
Expand All @@ -422,4 +422,7 @@ def test_invalid_content_types(content_type):
],
)
def test_guess_content_type(filename, content_type):
assert content_types.guess(filename) == content_type
if isinstance(content_type, list):
assert content_types.guess(filename) in content_type
else:
assert content_types.guess(filename) == content_type
4 changes: 4 additions & 0 deletions nucliadb_models/src/nucliadb_models/content_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@

EXTRA_VALID_CONTENT_TYPES = {
"application/font-woff",
"application/mp4",
"application/toml",
"application/vnd.jgraph.mxfile",
"application/vnd.ms-excel.sheet.macroenabled.12",
"application/vnd.ms-outlook",
"application/vnd.ms-word.document.macroenabled.12",
"application/vnd.rar",
"application/x-aportisdoc",
"application/x-archive",
Expand All @@ -43,9 +45,11 @@
"application/x-iwork-pages-sffpages",
"application/x-mach-binary",
"application/x-mobipocket-ebook",
"application/x-ms-shortcut",
"application/x-msdownload",
"application/x-ndjson",
"application/x-openscad",
"application/x-sql",
"application/x-zip-compressed",
"application/zstd",
"audio/vnd.dlna.adts",
Expand Down

0 comments on commit 62dc811

Please sign in to comment.