Skip to content

Commit

Permalink
feat: frontend webpack proxy support zstd encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
dechao.cdc committed Aug 2, 2024
1 parent 40520c5 commit f62a3a4
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
104 changes: 104 additions & 0 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
"rimraf": "^6.0.1",
"rison": "^0.1.1",
"scroll-into-view-if-needed": "^3.1.0",
"simple-zstd": "^1.4.2",
"tinycolor2": "^1.4.2",
"urijs": "^1.19.8",
"use-event-callback": "^0.1.0",
Expand Down
3 changes: 3 additions & 0 deletions superset-frontend/webpack.proxy-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
const zlib = require('zlib');
const { ZSTDDecompress } = require('simple-zstd');

const yargs = require('yargs');
// eslint-disable-next-line import/no-extraneous-dependencies
Expand Down Expand Up @@ -127,6 +128,8 @@ function processHTML(proxyResponse, response) {
uncompress = zlib.createBrotliDecompress();
} else if (responseEncoding === 'deflate') {
uncompress = zlib.createInflate();
} else if (responseEncoding === 'zstd') {
uncompress = ZSTDDecompress();
}
if (uncompress) {
originalResponse.pipe(uncompress);
Expand Down

0 comments on commit f62a3a4

Please sign in to comment.