mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 13:52:09 +03:00
Re-lands the #6098 ws-externalization fix onto release/v3.8.44 (it had merged to main by mistake and was reverted). Externalize ws/bufferutil/utf-8-validate so the copilot-m365-web WebSocket masking path works at runtime. Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
This commit is contained in:
committed by
GitHub
parent
dbc0cdbe1b
commit
1f1fda7cf5
@@ -214,6 +214,13 @@ const nextConfig = {
|
||||
"tough-cookie",
|
||||
"@ngrok/ngrok",
|
||||
"@huggingface/transformers",
|
||||
// copilot-m365-web.ts imports 'ws' as a client-side WebSocket. When bundled,
|
||||
// ws cannot resolve its 'bufferutil' native addon (frame masking) and throws
|
||||
// TypeError: b.mask is not a function on the first outgoing frame, causing
|
||||
// every chat request to time out at the stream-readiness watchdog. (#6062)
|
||||
"ws",
|
||||
"bufferutil",
|
||||
"utf-8-validate",
|
||||
"child_process",
|
||||
"fs",
|
||||
"path",
|
||||
|
||||
@@ -37,6 +37,15 @@ test("next config exposes standalone build settings and canonical rewrites", asy
|
||||
"fumadocs-ui",
|
||||
"fumadocs-core",
|
||||
]);
|
||||
// #6062: `ws` and its native masking helpers must stay external so the
|
||||
// copilot-m365-web executor keeps a working WebSocket masking path at runtime
|
||||
// (bundling ws breaks `bufferutil` → `TypeError: b.mask is not a function`).
|
||||
for (const pkg of ["ws", "bufferutil", "utf-8-validate"]) {
|
||||
assert.ok(
|
||||
nextConfig.serverExternalPackages.includes(pkg),
|
||||
`expected serverExternalPackages to externalize "${pkg}" (#6062)`
|
||||
);
|
||||
}
|
||||
assert.equal(headers[0].source, "/:path*");
|
||||
assert.match(securityHeaders["Content-Security-Policy"], /default-src 'self'/);
|
||||
assert.match(securityHeaders["Content-Security-Policy"], /frame-ancestors 'none'/);
|
||||
|
||||
Reference in New Issue
Block a user