@peopl-health/nexus 4.2.1 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,8 +35,9 @@ const getMediaController = async (req, res) => {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const mediaKey = key.startsWith('signed-url/') ? key.slice('signed-url/'.length) : key;
|
|
39
|
+
const fileData = await downloadFileFromS3(bucketName, mediaKey);
|
|
40
|
+
|
|
40
41
|
if (!fileData?.Body) {
|
|
41
42
|
return res.status(404).json({
|
|
42
43
|
success: false,
|
|
@@ -46,7 +47,7 @@ const getMediaController = async (req, res) => {
|
|
|
46
47
|
|
|
47
48
|
let contentType = fileData.ContentType || 'application/octet-stream';
|
|
48
49
|
if (contentType === 'application/octet-stream') {
|
|
49
|
-
const ext =
|
|
50
|
+
const ext = mediaKey.split('.').pop().toLowerCase();
|
|
50
51
|
contentType = MIME_MAP[ext] || contentType;
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -116,7 +116,7 @@ class MongoStorage {
|
|
|
116
116
|
prompt: messageData.prompt || null,
|
|
117
117
|
preset: messageData.preset || null,
|
|
118
118
|
response_id: messageData.response_id || null,
|
|
119
|
-
statusInfo: messageData.statusInfo
|
|
119
|
+
statusInfo: messageData.statusInfo,
|
|
120
120
|
clinical_context: messageData.clinicalContext || null,
|
|
121
121
|
triggeredBy: messageData.triggeredBy || null
|
|
122
122
|
};
|