Skip to content

Commit 0272c92

Browse files
committed
Update http-encoding to fix crashes due to wasm-brotli
We now use brotli-wasm instead, our own module which includes the latest version of brotli, and workarounds for webpack compilation issues that otherwise break all sorts of things.
1 parent 69fadb6 commit 0272c92

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

automation/webpack.common.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ export default <Webpack.Configuration>{
118118
// issues? This helps protect against possible corruptions:
119119
const manifest = originalManifest.map((entry: any) => {
120120
const asset = compilation.getAsset(entry.url);
121-
entry.integrity = ssri.fromData(asset.source.source()).toString();
121+
const assetSource = asset.source.source();
122+
entry.integrity = ssri.fromData(
123+
assetSource instanceof ArrayBuffer
124+
? Buffer.from(assetSource) // Wasm!
125+
: assetSource
126+
).toString();
122127
return entry;
123128
});
124129

custom-typings/wasm-brotli.d.ts

-1
This file was deleted.

netlify.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@
77
[[headers]]
88
for = "/*"
99
[headers.values]
10-
Content-Security-Policy = "frame-ancestors 'none'"
10+
Content-Security-Policy = "frame-ancestors 'none'"
11+
12+
[[headers]]
13+
for = "/*.wasm"
14+
[headers.values]
15+
Content-Type = "application/wasm"

package-lock.json

+9-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"dompurify": "^2.1.1",
8282
"graphql": "^14.7.0",
8383
"har-validator": "^5.1.3",
84-
"http-encoding": "^1.0.1",
84+
"http-encoding": "^1.1.0",
8585
"httpsnippet": "^1.25.0",
8686
"idb-keyval": "^3.2.0",
8787
"js-beautify": "^1.8.8",

0 commit comments

Comments
 (0)