@jsenv/server 15.4.0 → 15.4.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/server",
3
- "version": "15.4.0",
3
+ "version": "15.4.1",
4
4
  "description": "Write your Node.js server using pure functions",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -372,6 +372,10 @@ const getMtimeResponse = async ({ headers, fileStat }) => {
372
372
  };
373
373
 
374
374
  const getCompressedResponse = async ({ fileUrl, headers }) => {
375
+ const contentType = CONTENT_TYPE.fromUrlExtension(fileUrl);
376
+ if (CONTENT_TYPE.isBinary(contentType)) {
377
+ return null;
378
+ }
375
379
  const acceptedCompressionFormat = pickContentEncoding(
376
380
  { headers },
377
381
  Object.keys(availableCompressionFormats),
@@ -389,7 +393,7 @@ const getCompressedResponse = async ({ fileUrl, headers }) => {
389
393
  return {
390
394
  status: 200,
391
395
  headers: {
392
- "content-type": CONTENT_TYPE.fromUrlExtension(fileUrl),
396
+ "content-type": contentType,
393
397
  "content-encoding": acceptedCompressionFormat,
394
398
  "vary": "accept-encoding",
395
399
  },