coderaft 0.0.35 → 0.0.36
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/code.mjs +1 -1
- package/code.tar.zst +0 -0
- package/dist/_chunks/libs/httpxy.mjs +16 -1
- package/package.json +22 -14
package/code.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { tmpdir } from "node:os";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
// Auto-updated by scripts/pack.ts
|
|
7
|
-
const codeArchiveHash = "
|
|
7
|
+
const codeArchiveHash = "3973e2b5b756d531";
|
|
8
8
|
|
|
9
9
|
const archivePath = fileURLToPath(new URL("./code.tar.zst", import.meta.url));
|
|
10
10
|
|
package/code.tar.zst
CHANGED
|
Binary file
|
|
@@ -3,6 +3,7 @@ import httpsNative from "node:https";
|
|
|
3
3
|
import http2 from "node:http2";
|
|
4
4
|
import { EventEmitter } from "node:events";
|
|
5
5
|
const upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;
|
|
6
|
+
const transferEncodingConnectionToken = /(^|,)\s*transfer-encoding\s*($|,)/i;
|
|
6
7
|
const defaultAgents = {
|
|
7
8
|
http: new httpNative.Agent({
|
|
8
9
|
keepAlive: true,
|
|
@@ -16,6 +17,16 @@ const defaultAgents = {
|
|
|
16
17
|
})
|
|
17
18
|
};
|
|
18
19
|
const isSSL = /^https|wss/;
|
|
20
|
+
function forceConnectionCloseForTransferEncoding(headers) {
|
|
21
|
+
let carriesTransferEncoding = false;
|
|
22
|
+
for (const key in headers) if (headers[key] !== void 0 && key.toLowerCase() === "transfer-encoding") {
|
|
23
|
+
carriesTransferEncoding = true;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
const connection = headers.connection;
|
|
27
|
+
const connectionMarksTransferEncoding = typeof connection === "string" && transferEncodingConnectionToken.test(connection);
|
|
28
|
+
if (carriesTransferEncoding || connectionMarksTransferEncoding) headers.connection = "close";
|
|
29
|
+
}
|
|
19
30
|
const HTTP2_HEADER_BLACKLIST = [
|
|
20
31
|
":method",
|
|
21
32
|
":path",
|
|
@@ -62,6 +73,8 @@ function setupOutgoing(outgoing, options, req, forward) {
|
|
|
62
73
|
outgoing.headers = outgoing.headers || {};
|
|
63
74
|
if (typeof outgoing.headers.connection !== "string" || !upgradeHeader.test(outgoing.headers.connection)) outgoing.headers.connection = "close";
|
|
64
75
|
}
|
|
76
|
+
outgoing.headers = outgoing.headers || {};
|
|
77
|
+
forceConnectionCloseForTransferEncoding(outgoing.headers);
|
|
65
78
|
const target = options[forward || "target"];
|
|
66
79
|
const targetPath = target && options.prependPath !== false ? target.pathname || "" : "";
|
|
67
80
|
const targetSearch = target instanceof URL && options.prependPath !== false ? target.search || "" : "";
|
|
@@ -152,6 +165,7 @@ const webOutgoingMiddleware = [
|
|
|
152
165
|
defineProxyOutgoingMiddleware((req, res, proxyRes, options) => {
|
|
153
166
|
if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) && proxyRes.headers.location && redirectRegex.test(String(proxyRes.statusCode))) {
|
|
154
167
|
const target = _toURL(options.target);
|
|
168
|
+
const keepProtocolRelative = proxyRes.headers.location.startsWith("//") && !options.protocolRewrite;
|
|
155
169
|
const u = new URL(proxyRes.headers.location, target);
|
|
156
170
|
if (target.host !== u.host) return;
|
|
157
171
|
if (options.hostRewrite) u.host = options.hostRewrite;
|
|
@@ -160,7 +174,7 @@ const webOutgoingMiddleware = [
|
|
|
160
174
|
else if (req.headers.host) u.host = req.headers.host;
|
|
161
175
|
}
|
|
162
176
|
if (options.protocolRewrite) u.protocol = options.protocolRewrite;
|
|
163
|
-
proxyRes.headers.location = u.
|
|
177
|
+
proxyRes.headers.location = keepProtocolRelative ? u.href.slice(u.protocol.length) : u.href;
|
|
164
178
|
}
|
|
165
179
|
}),
|
|
166
180
|
defineProxyOutgoingMiddleware((req, res, proxyRes, options) => {
|
|
@@ -319,6 +333,7 @@ const webIncomingMiddleware = [
|
|
|
319
333
|
delete redirectHeaders["content-type"];
|
|
320
334
|
delete redirectHeaders["transfer-encoding"];
|
|
321
335
|
}
|
|
336
|
+
forceConnectionCloseForTransferEncoding(redirectHeaders);
|
|
322
337
|
const redirectOpts = {
|
|
323
338
|
hostname: location.hostname,
|
|
324
339
|
port: location.port || (isHTTPS ? 443 : 80),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coderaft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"repository": "pithings/coderaft",
|
|
5
5
|
"bin": {
|
|
6
6
|
"coderaft": "./dist/cli.mjs"
|
|
@@ -31,35 +31,40 @@
|
|
|
31
31
|
"build": "obuild"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"code-server": "https://github.com/coder/code-server/releases/download/v4.
|
|
34
|
+
"code-server": "https://github.com/coder/code-server/releases/download/v4.128.0/package.tar.gz",
|
|
35
35
|
"@github/copilot": "workspace:*",
|
|
36
36
|
"@github/copilot-sdk": "workspace:*",
|
|
37
37
|
"@microsoft/1ds-core-js": "workspace:*",
|
|
38
38
|
"@microsoft/1ds-post-js": "workspace:*",
|
|
39
|
+
"@microsoft/mxc-sdk": "0.6.1",
|
|
39
40
|
"@parcel/watcher": "workspace:*",
|
|
41
|
+
"@vscode/copilot-api": "^0.4.2",
|
|
40
42
|
"@vscode/deviceid": "workspace:*",
|
|
41
43
|
"@vscode/fs-copyfile": "workspace:*",
|
|
42
44
|
"@vscode/iconv-lite-umd": "0.7.1",
|
|
43
45
|
"@vscode/native-watchdog": "workspace:*",
|
|
44
46
|
"@vscode/proxy-agent": "workspace:*",
|
|
45
47
|
"@vscode/ripgrep": "workspace:*",
|
|
48
|
+
"@vscode/ripgrep-universal": "workspace:*",
|
|
49
|
+
"@vscode/sandbox-runtime": "0.0.1",
|
|
46
50
|
"@vscode/spdlog": "workspace:*",
|
|
47
51
|
"@vscode/sqlite3": "workspace:*",
|
|
48
52
|
"@vscode/tree-sitter-wasm": "^0.3.1",
|
|
49
53
|
"@vscode/vscode-languagedetection": "1.0.23",
|
|
50
54
|
"@vscode/windows-process-tree": "workspace:*",
|
|
51
55
|
"@vscode/windows-registry": "workspace:*",
|
|
52
|
-
"@xterm/addon-clipboard": "^0.3.0-beta.
|
|
53
|
-
"@xterm/addon-image": "^0.10.0-beta.
|
|
54
|
-
"@xterm/addon-ligatures": "^0.11.0-beta.
|
|
55
|
-
"@xterm/addon-progress": "^0.3.0-beta.
|
|
56
|
-
"@xterm/addon-search": "^0.17.0-beta.
|
|
57
|
-
"@xterm/addon-serialize": "^0.15.0-beta.
|
|
58
|
-
"@xterm/addon-unicode11": "^0.10.0-beta.
|
|
59
|
-
"@xterm/addon-webgl": "^0.20.0-beta.
|
|
60
|
-
"@xterm/headless": "^6.1.0-beta.
|
|
61
|
-
"@xterm/xterm": "^6.1.0-beta.
|
|
56
|
+
"@xterm/addon-clipboard": "^0.3.0-beta.285",
|
|
57
|
+
"@xterm/addon-image": "^0.10.0-beta.285",
|
|
58
|
+
"@xterm/addon-ligatures": "^0.11.0-beta.285",
|
|
59
|
+
"@xterm/addon-progress": "^0.3.0-beta.285",
|
|
60
|
+
"@xterm/addon-search": "^0.17.0-beta.285",
|
|
61
|
+
"@xterm/addon-serialize": "^0.15.0-beta.285",
|
|
62
|
+
"@xterm/addon-unicode11": "^0.10.0-beta.285",
|
|
63
|
+
"@xterm/addon-webgl": "^0.20.0-beta.284",
|
|
64
|
+
"@xterm/headless": "^6.1.0-beta.285",
|
|
65
|
+
"@xterm/xterm": "^6.1.0-beta.285",
|
|
62
66
|
"cookie": "^0.7.0",
|
|
67
|
+
"detect-libc": "^2.1.2",
|
|
63
68
|
"http-proxy-agent": "^7.0.0",
|
|
64
69
|
"https-proxy-agent": "^7.0.2",
|
|
65
70
|
"httpxy": "^0.5.0",
|
|
@@ -67,15 +72,18 @@
|
|
|
67
72
|
"katex": "^0.16.22",
|
|
68
73
|
"kerberos": "workspace:*",
|
|
69
74
|
"minimist": "^1.2.8",
|
|
75
|
+
"node-addon-api": "^6.0.0",
|
|
70
76
|
"node-pty": "workspace:*",
|
|
71
77
|
"ssh2": "workspace:*",
|
|
78
|
+
"tar": "^7.5.9",
|
|
72
79
|
"tas-client": "0.3.1",
|
|
73
80
|
"typescript": "^6.0.3",
|
|
74
81
|
"vscode-oniguruma": "1.7.0",
|
|
75
82
|
"vscode-regexpp": "^3.1.0",
|
|
76
83
|
"vscode-textmate": "^9.3.2",
|
|
77
84
|
"ws": "^8.19.0",
|
|
78
|
-
"yauzl": "^3.
|
|
79
|
-
"yazl": "^2.4.3"
|
|
85
|
+
"yauzl": "^3.3.1",
|
|
86
|
+
"yazl": "^2.4.3",
|
|
87
|
+
"zod": "^3.25.76"
|
|
80
88
|
}
|
|
81
89
|
}
|