fix(ci): fix discord proxy websocket binding and bluebubbles timeout status

This commit is contained in:
Peter Steinberger
2026-02-13 19:35:43 +00:00
parent d3b2135f86
commit f02247b6c5
2 changed files with 10 additions and 7 deletions
+7 -1
View File
@@ -335,7 +335,13 @@ export async function handleBlueBubblesWebhookRequest(
const body = await readJsonBody(req, 1024 * 1024); const body = await readJsonBody(req, 1024 * 1024);
if (!body.ok) { if (!body.ok) {
res.statusCode = body.error === "payload too large" ? 413 : 400; if (body.error === "payload too large") {
res.statusCode = 413;
} else if (body.error === "request body timeout") {
res.statusCode = 408;
} else {
res.statusCode = 400;
}
res.end(body.error ?? "invalid payload"); res.end(body.error ?? "invalid payload");
console.warn(`[bluebubbles] webhook rejected: ${body.error ?? "invalid payload"}`); console.warn(`[bluebubbles] webhook rejected: ${body.error ?? "invalid payload"}`);
return true; return true;
+3 -6
View File
@@ -79,19 +79,16 @@ function createDiscordGatewayPlugin(params: {
params.runtime.log?.("discord: gateway proxy enabled"); params.runtime.log?.("discord: gateway proxy enabled");
class ProxyGatewayPlugin extends GatewayPlugin { class ProxyGatewayPlugin extends GatewayPlugin {
#proxyAgent: HttpsProxyAgent<string>; constructor() {
constructor(proxyAgent: HttpsProxyAgent<string>) {
super(options); super(options);
this.#proxyAgent = proxyAgent;
} }
createWebSocket(url: string) { createWebSocket(url: string) {
return new WebSocket(url, { agent: this.#proxyAgent }); return new WebSocket(url, { agent });
} }
} }
return new ProxyGatewayPlugin(agent); return new ProxyGatewayPlugin();
} catch (err) { } catch (err) {
params.runtime.error?.(danger(`discord: invalid gateway proxy: ${String(err)}`)); params.runtime.error?.(danger(`discord: invalid gateway proxy: ${String(err)}`));
return new GatewayPlugin(options); return new GatewayPlugin(options);