billion-context 0.1.63-pr.347.202 → 0.1.63-pr.352.204

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/index.js CHANGED
@@ -53902,9 +53902,6 @@ var rootCert;
53902
53902
  var rootKey;
53903
53903
  var secureContextCache = /* @__PURE__ */ new Map();
53904
53904
  var SECURE_CONTEXT_CACHE_MAX = 64;
53905
- function rootCaPath() {
53906
- return path7.join(caDir(), ROOT_CERT_FILE);
53907
- }
53908
53905
  function collectSystemCaPems(env = process.env) {
53909
53906
  const pems = [];
53910
53907
  const seen = /* @__PURE__ */ new Set();
@@ -54539,15 +54536,6 @@ var DEFAULT_MITM_DOMAINS = [
54539
54536
  "chatgpt.com"
54540
54537
  ];
54541
54538
  var MITM_UPSTREAM_KEY = "__biliMitmUpstream";
54542
- var warnedCertRejected = false;
54543
- var CERT_REJECT_RE = /alert (?:certificate unknown|unknown ca|bad certificate|certificate expired|certificate revoked|unsupported certificate)/i;
54544
- function noteMitmTlsError(host, port, message, log2) {
54545
- log2(`mitm ${maskHostForLog(host)}:${port} TLS error: ${message}`);
54546
- if (CERT_REJECT_RE.test(message) && !warnedCertRejected) {
54547
- warnedCertRejected = true;
54548
- log2(`mitm ${maskHostForLog(host)}:${port} client REJECTED the MITM certificate \u2014 it does not trust bili's root CA. Install it in the client's/system trust store, then restart the client. CA: ${rootCaPath()}`);
54549
- }
54550
- }
54551
54539
  var MITM_HANDSHAKE_TIMEOUT_MS_DEFAULT = 1e4;
54552
54540
  function mitmHandshakeTimeoutMs() {
54553
54541
  const v2 = Number.parseInt(process.env.BILI_MITM_HANDSHAKE_TIMEOUT_MS ?? "", 10);
@@ -54613,7 +54601,6 @@ function tunnelThrough(clientSocket, host, port, head, log2, proxyUrl) {
54613
54601
  if (head.length > 0) upstream.write(head);
54614
54602
  upstream.pipe(clientSocket);
54615
54603
  clientSocket.pipe(upstream);
54616
- log2(`tunnel ${maskHostForLog(host)}:${port} established (blind TCP, not decrypted)`);
54617
54604
  const cleanup = (where, err2) => {
54618
54605
  log2(`tunnel ${maskHostForLog(host)}:${port} ${where} closed: ${maskHostInText(err2.message, host)}`);
54619
54606
  upstream.destroy();
@@ -54648,7 +54635,7 @@ function doMitm(server, clientSocket, host, port, head, log2) {
54648
54635
  }
54649
54636
  tlsSocket[MITM_UPSTREAM_KEY] = `https://${host}`;
54650
54637
  tlsSocket.on("error", (err2) => {
54651
- noteMitmTlsError(host, port, err2.message, log2);
54638
+ log2(`mitm ${maskHostForLog(host)}:${port} TLS error: ${err2.message}`);
54652
54639
  tlsSocket.destroy();
54653
54640
  clientSocket.destroy();
54654
54641
  });
@@ -55765,11 +55752,6 @@ async function handle(req, res, opts, core, config, log2, instanceId) {
55765
55752
  return;
55766
55753
  }
55767
55754
  }
55768
- if (isAdminPath) {
55769
- res.writeHead(404, { "content-type": "application/json" });
55770
- res.end(JSON.stringify({ error: { type: "not_found", message: "no such management endpoint" } }));
55771
- return;
55772
- }
55773
55755
  let bodyBuffer;
55774
55756
  let urlPath;
55775
55757
  let responsesCompact;