@middy/http-content-encoding 5.4.6 → 5.5.0

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.
Files changed (2) hide show
  1. package/index.js +5 -1
  2. package/package.json +4 -3
package/index.js CHANGED
@@ -22,6 +22,10 @@ const defaults = {
22
22
  overridePreferredEncoding: []
23
23
  }
24
24
 
25
+ export const getStream = (preferredEncoding) => {
26
+ return contentEncodingStreams[preferredEncoding]()
27
+ }
28
+
25
29
  /*
26
30
  * `zstd` disabled due to lack of support in nodejs
27
31
  * https://github.com/andrew-aladev/brotli-vs-zstd
@@ -65,7 +69,7 @@ const httpContentEncodingMiddleware = (opts) => {
65
69
  // Support streamifyResponse
66
70
  if (response.body?._readableState) {
67
71
  request.response.headers['Content-Encoding'] = contentEncoding
68
- request.response.body.pipe(contentEncodingStream)
72
+ request.response.body = request.response.body.pipe(contentEncodingStream)
69
73
  return
70
74
  }
71
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/http-content-encoding",
3
- "version": "5.4.6",
3
+ "version": "5.5.0",
4
4
  "description": "Http content encoding middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -63,10 +63,11 @@
63
63
  "url": "https://github.com/sponsors/willfarrell"
64
64
  },
65
65
  "dependencies": {
66
- "@middy/util": "5.4.6"
66
+ "@middy/util": "5.5.0"
67
67
  },
68
68
  "devDependencies": {
69
- "@middy/core": "5.4.6"
69
+ "@datastream/core": "0.0.38",
70
+ "@middy/core": "5.5.0"
70
71
  },
71
72
  "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
72
73
  }