mockaton 8.12.1 → 8.12.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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mockaton",
3
3
  "description": "A deterministic server-side for developing and testing APIs",
4
4
  "type": "module",
5
- "version": "8.12.1",
5
+ "version": "8.12.2",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",
8
8
  "license": "MIT",
@@ -19,14 +19,8 @@ export async function dispatchStatic(req, response) {
19
19
  if (req.headers.range)
20
20
  await sendPartialContent(response, req.headers.range, file)
21
21
  else {
22
- const contentType = mimeFor(file)
23
- response.setHeader('Content-Type', contentType)
24
- // Use binary encoding for non-text files
25
- const isTextFile = contentType.startsWith('text/') ||
26
- contentType === 'application/json' ||
27
- contentType === 'application/javascript' ||
28
- contentType === 'application/xml';
29
- response.end(readFileSync(file, isTextFile ? 'utf8' : null))
22
+ response.setHeader('Content-Type', mimeFor(file))
23
+ response.end(readFileSync(file))
30
24
  }
31
25
  }
32
26