Skip to content

Commit

Permalink
fix: Handle zstd encoding in webpack proxy config (#30034)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje authored Aug 28, 2024
1 parent e886cc4 commit 75c500c
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RUN apt-get update -qq \
&& apt-get install \
-yqq --no-install-recommends \
build-essential \
python3
python3 \
zstd

ENV BUILD_CMD=${NPM_BUILD_CMD} \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
Expand Down
120 changes: 111 additions & 9 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 @@ -201,6 +201,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 75c500c

Please sign in to comment.