@peopl-health/nexus 4.2.1 → 4.2.2

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 fileData = await downloadFileFromS3(bucketName, key);
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 = key.split('.').pop().toLowerCase();
50
+ const ext = mediaKey.split('.').pop().toLowerCase();
50
51
  contentType = MIME_MAP[ext] || contentType;
51
52
  }
52
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "4.2.1",
3
+ "version": "4.2.2",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",