dx-server 0.14.0-alpha.2 → 0.14.0-alpha.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.
- package/lib/dxHelpers.js +5 -1
- package/package.json +1 -1
package/lib/dxHelpers.js
CHANGED
|
@@ -39,7 +39,11 @@ export async function writeRes(req, res, { type, data, charset, jsonBeautify, di
|
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
41
|
case 'file':
|
|
42
|
-
|
|
42
|
+
// streams have no intrinsic type, so default them to octet-stream. files do NOT get a
|
|
43
|
+
// default here: sendFileTrusted derives Content-Type from the file extension (and falls
|
|
44
|
+
// back to octet-stream itself). pre-setting it would suppress that extension detection.
|
|
45
|
+
if (type !== 'file')
|
|
46
|
+
setContentType('application/octet-stream');
|
|
43
47
|
try {
|
|
44
48
|
if (type === 'file')
|
|
45
49
|
await sendFileTrusted(req, res, data, options);
|