From 7efe232d3aa9a4bc288b1596e0a943af2e0b0bb3 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Tue, 29 Oct 2024 10:05:11 -0400 Subject: [PATCH] chore: comment on MIME type logic --- chord_drs/routes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chord_drs/routes.py b/chord_drs/routes.py index 3fae4f1..bf42e26 100644 --- a/chord_drs/routes.py +++ b/chord_drs/routes.py @@ -252,7 +252,10 @@ def object_download(object_id: str): obj_name = drs_object.name minio_obj = drs_object.return_minio_object() - mime_type = drs_object.mime_type or MIME_OCTET_STREAM + + # DRS objects have a nullable mime_type in the database. If mime_type is None, serve the object as a generic + # application/octet-stream. + mime_type: str = drs_object.mime_type or MIME_OCTET_STREAM if not minio_obj: # Check for "Range" HTTP header