@middy/http-content-encoding 4.3.0 → 4.4.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.
- package/index.cjs +9 -7
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -4,15 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(module, "exports", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
+
const _nodestream = require("node:stream");
|
|
12
|
+
const _nodezlib = require("node:zlib");
|
|
11
13
|
const _util = require("@middy/util");
|
|
12
14
|
const contentEncodingStreams = {
|
|
13
|
-
br:
|
|
14
|
-
gzip:
|
|
15
|
-
deflate:
|
|
15
|
+
br: _nodezlib.createBrotliCompress,
|
|
16
|
+
gzip: _nodezlib.createGzip,
|
|
17
|
+
deflate: _nodezlib.createDeflate
|
|
16
18
|
};
|
|
17
19
|
const defaults = {
|
|
18
20
|
br: undefined,
|
|
@@ -45,7 +47,7 @@ const httpContentEncodingMiddleware = (opts)=>{
|
|
|
45
47
|
request.response.body.pipe(contentEncodingStream);
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
|
-
const stream =
|
|
50
|
+
const stream = _nodestream.Readable.from(response.body).pipe(contentEncodingStream);
|
|
49
51
|
const chunks = [];
|
|
50
52
|
for await (const chunk of stream){
|
|
51
53
|
chunks.push(chunk);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-content-encoding",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Http content encoding middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"url": "https://github.com/sponsors/willfarrell"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@middy/util": "4.
|
|
72
|
+
"@middy/util": "4.4.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@middy/core": "4.
|
|
75
|
+
"@middy/core": "4.4.0"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "5b574488798c48bc74269af7deb3ff95139bcdcc"
|
|
78
78
|
}
|