@staff0rd/assist 0.757.0 → 0.757.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/sessions/web/bundle.js +285 -285
- package/dist/index.js +16 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.757.
|
|
9
|
+
version: "0.757.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -15033,6 +15033,20 @@ import {
|
|
|
15033
15033
|
} from "http";
|
|
15034
15034
|
import { request as httpsRequest } from "https";
|
|
15035
15035
|
|
|
15036
|
+
// src/commands/sessions/web/peerTimeoutMs.ts
|
|
15037
|
+
var peerTimeoutMs = 2e4;
|
|
15038
|
+
|
|
15039
|
+
// src/commands/sessions/web/boundUpstream.ts
|
|
15040
|
+
function boundUpstream(upstream, res) {
|
|
15041
|
+
upstream.setTimeout(
|
|
15042
|
+
peerTimeoutMs,
|
|
15043
|
+
() => upstream.destroy(new Error(`no response after ${peerTimeoutMs}ms`))
|
|
15044
|
+
);
|
|
15045
|
+
res.on("close", () => {
|
|
15046
|
+
if (!res.writableFinished) upstream.destroy();
|
|
15047
|
+
});
|
|
15048
|
+
}
|
|
15049
|
+
|
|
15036
15050
|
// src/commands/sessions/web/isQuietPoll.ts
|
|
15037
15051
|
var POLLED_PATHS = /* @__PURE__ */ new Set(["/api/git-status"]);
|
|
15038
15052
|
function isQuietPoll(pathname, status2) {
|
|
@@ -15071,6 +15085,7 @@ function forwardToPeer(req, res, node, url) {
|
|
|
15071
15085
|
},
|
|
15072
15086
|
(peer) => relayPeerResponse(peer, res, url.pathname, log2, resolve26)
|
|
15073
15087
|
);
|
|
15088
|
+
boundUpstream(upstream, res);
|
|
15074
15089
|
upstream.on("error", (error) => {
|
|
15075
15090
|
log2(`failed: ${error.message}`);
|
|
15076
15091
|
if (res.headersSent) res.destroy();
|